Problem: TileCondition (used by QueueTask.waitTile(Tile) does not work correctly.
Symptom: Tile properties that are used in Tile.sameAs(Tile) are val thus cannot be changed. When a Tile was passed to TileCondition as src. It seems as though the intention was for src to update as a reference the properties update, but the properties will never update (because they are val), thus rendering TileCondition useless.
Solution: TileCondition now takes Pawn and Tile (TileCondition(Pawn, Tile)), and since Pawn.tile is a var it means that it changes as Pawn.tile changes, and it allows TileCondition to work as expected.
QueueTask.waitTile(tile: Tile) has been changed to QueueTask.waitTile(tile: Tile, pawn: Pawn = ctx as Pawn) to keep backwards compatibility and preserve previous functionality while also giving the developer a bit more control over which Pawn they want to reach the tile before continuing the logic.
Problem:
TileCondition
(used byQueueTask.waitTile(Tile)
does not work correctly.Symptom:
Tile
properties that are used inTile.sameAs(Tile)
areval
thus cannot be changed. When aTile
was passed toTileCondition
assrc
. It seems as though the intention was forsrc
to update as a reference the properties update, but the properties will never update (because they areval
), thus renderingTileCondition
useless.Solution:
TileCondition
now takesPawn
andTile
(TileCondition(Pawn, Tile)
), and sincePawn.tile
is avar
it means that it changes asPawn.tile
changes, and it allowsTileCondition
to work as expected.QueueTask.waitTile(tile: Tile)
has been changed toQueueTask.waitTile(tile: Tile, pawn: Pawn = ctx as Pawn)
to keep backwards compatibility and preserve previous functionality while also giving the developer a bit more control over whichPawn
they want to reach the tile before continuing the logic.