diff --git a/runelite-api/src/main/java/net/runelite/api/Tile.java b/runelite-api/src/main/java/net/runelite/api/Tile.java index 691e3b5f87..4c2213aff5 100644 --- a/runelite-api/src/main/java/net/runelite/api/Tile.java +++ b/runelite-api/src/main/java/net/runelite/api/Tile.java @@ -24,14 +24,12 @@ */ package net.runelite.api; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; import java.util.List; /** * Represents a tile in the game. */ -public interface Tile +public interface Tile extends TileObject { /** * Gets the decoration on the tile. @@ -82,13 +80,6 @@ public interface Tile */ TileModel getTileModel(); - /** - * Gets the location coordinate of the tile in the world. - * - * @return the world location - */ - WorldPoint getWorldLocation(); - /** * Gets the location coordinate of the tile in scene coords * @@ -96,20 +87,6 @@ public interface Tile */ Point getSceneLocation(); - /** - * Gets the local coordinate of the tile. - * - * @return the local location - */ - LocalPoint getLocalLocation(); - - /** - * Gets the plane that this tile is on. - * - * @return the plane - */ - int getPlane(); - /** * Get the plane this tile is rendered on, which is where the tile heights are from. * diff --git a/runelite-api/src/main/java/net/runelite/api/TileObject.java b/runelite-api/src/main/java/net/runelite/api/TileObject.java index 06a10f363e..2168c1ed6c 100644 --- a/runelite-api/src/main/java/net/runelite/api/TileObject.java +++ b/runelite-api/src/main/java/net/runelite/api/TileObject.java @@ -25,7 +25,6 @@ package net.runelite.api; import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Shape; @@ -65,10 +64,6 @@ public interface TileObject extends Locatable */ int getId(); - WorldPoint getWorldLocation(); - - LocalPoint getLocalLocation(); - /** * Calculates the position of the center of this tile on the canvas */ diff --git a/runelite-api/src/main/java/net/runelite/api/queries/TileQuery.java b/runelite-api/src/main/java/net/runelite/api/queries/TileQuery.java new file mode 100644 index 0000000000..2918b47539 --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/queries/TileQuery.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019, tha23rd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.api.queries; + +import java.util.Objects; +import java.util.stream.Collectors; +import net.runelite.api.Client; +import net.runelite.api.LocatableQueryResults; +import net.runelite.api.Tile; + +public class TileQuery extends TileObjectQuery +{ + @Override + public LocatableQueryResults result(Client client) + { + return new LocatableQueryResults<>(getTiles(client).stream() + .filter(Objects::nonNull) + .filter(predicate) + .distinct() + .collect(Collectors.toList())); + } + +} \ No newline at end of file