Tile

data class Tile(x: Int, y: Int, floor: Int) : Locatable, Validatable

Constructors

Tile
Link copied to clipboard
fun Tile(x: Int, y: Int)

Types

Companion
Link copied to clipboard
object Companion

Functions

blocked
Link copied to clipboard
fun blocked(flags: Array<IntArray>): Boolean

Checks whether or not the collision flags for the current tile contains any of the default blocking flags.

fun blocked(flags: Array<IntArray>, blockFlag: Int): Boolean

Checks whether or not the collision flags for the current tile contains any of the default or provided blocking flags.

collisionFlag
Link copied to clipboard
fun collisionFlag(flags: Array<IntArray>): Int

Retrieves the collision flag for the current tile from the provided ICollisionMap.

derive
Link copied to clipboard
fun derive(x: Int, y: Int): Tile
fun derive(x: Int, y: Int, z: Int): Tile

Calculates a derivative with the specified parameters.

distance
Link copied to clipboard
fun distance(): Double

Calculates the euclidean distance between the Tile and the local Player

distanceTo
Link copied to clipboard
fun distanceTo(l: Locatable?): Double

Calculates the euclidean distance between the Tile and the given Locatable.

drawCollisions
Link copied to clipboard
fun drawCollisions(g: Graphics, flags: Array<IntArray>)

Draw the collisions of the tile on the map The sides are colored depending on whether or not that side is blocked. If the complete tile is blocked, all sides are automatically colored red

drawOnScreen
Link copied to clipboard
fun drawOnScreen(g: Graphics, text: String? = null, outlineColor: Int? = Color.GREEN, fillColor: Int? = null)

Draw the edges of the tile on the screen with the given outlineColor //TODO Add graphics.fillPolygon

floor
Link copied to clipboard
fun floor(): Int
isRendered
Link copied to clipboard
open fun isRendered(): Boolean
loaded
Link copied to clipboard
fun loaded(): Boolean

The full region is 104 x 104 tiles. However, RS adds a special flag to any edge tile on an odd edge case For X and Y indexes 0, 99, 100, 101, 102 and 103 are considered edge cases.

localX
Link copied to clipboard
fun localX(): Int
localY
Link copied to clipboard
fun localY(): Int
matrix
Link copied to clipboard
fun matrix(): TileMatrix

Constructs a TileMatrix for the given Tile.

reachable
Link copied to clipboard
open fun reachable(): Boolean

Whether or not the Locatable can be reached. If the tile is blocked, the nearest unblocked tile will be used.

tile
Link copied to clipboard
open override fun tile(): Tile

The current location of the entity.

toString
Link copied to clipboard
open override fun toString(): String
valid
Link copied to clipboard
open override fun valid(): Boolean
x
Link copied to clipboard
fun x(): Int
y
Link copied to clipboard
fun y(): Int

Properties

floor
Link copied to clipboard
@SerializedName(value = "floor")
val floor: Int
x
Link copied to clipboard
@SerializedName(value = "x")
val x: Int
y
Link copied to clipboard
@SerializedName(value = "y")
val y: Int

Extensions

distanceM
Link copied to clipboard
fun Tile.distanceM(dest: Tile): Int
getPassableObject
Link copied to clipboard
fun Tile.getPassableObject(orientation: Int): GameObject?
rockfallBlock
Link copied to clipboard
fun Tile.rockfallBlock(flags: Array<IntArray>): Boolean
toWebTile
Link copied to clipboard
fun Tile.toWebTile(): WebTile