public void MoveActor(Actor actor, Direction dir)
{
if ((actor.tile != null) && (actor.tile.enabled))
{
Backend.Coords source = actor.tile.coords;
Backend.Coords target = DirectionTile(actor.tile.coords, dir);
if (this[target].coords.x > -1)
{
// Remove ActorTile from current tile
((FloorTile)actor.tile.parent).Remove(actor.tile);
// Add ActorTile to new Tile
_tiles[target.y][target.x].Add(actor.tile);
actor.tile.parent = _tiles[target.y][target.x];
// Remove old tile from updatelist (if no other actor or trap)
if (!((_tiles[source.y][source.x].hasEnemy)
|| (_tiles[source.y][source.x].hasPlayer)
|| (_tiles[source.y][source.x].hasTrap)))
_updateTiles.Remove(source);
// Add new tile to updatelist
_updateTiles.Add(target);
}
}
}