public bool Move(Cell cell, ISimplePathFinder pathFinder = null, int minDistance = 0, bool cautious = false, bool cancelMove = true) { if (cell == null) { throw new ArgumentNullException("cell"); } if (!CanMove()) { return(false); } if (pathFinder == null) { pathFinder = new BiM.Behaviors.Game.World.Pathfinding.FFPathFinding.PathFinder(Map, false); } Path path = null; if (pathFinder is IAdvancedPathFinder) { path = (pathFinder as IAdvancedPathFinder).FindPath(Cell, cell, true, -1, minDistance, cautious); } else { path = pathFinder.FindPath(Cell, cell, true, -1); } return(Move(path, cell)); }
public bool TryStartFightWith(GroupMonster monster, ISimplePathFinder pathFinder = null) { // todo var cell = monster.Cell; return(Move(cell, pathFinder)); }
public bool Move(short cellId, ISimplePathFinder pathFinder = null, int minDistance = 0, bool cautious = false, bool cancelMove = true) { if (CanMove()) { return(Move(Map.Cells[cellId], pathFinder, minDistance, cautious, cancelMove)); } return(false); }
public bool TryStartFightWith(GroupMonster monster, ISimplePathFinder pathFinder = null) { // todo var cell = monster.Cell; return Move(cell, pathFinder); }
public bool Move(Cell cell, ISimplePathFinder pathFinder = null, int minDistance = 0, bool cautious = false, bool cancelMove = true) { if (cell == null) throw new ArgumentNullException("cell"); if (!CanMove()) return false; if (pathFinder == null) pathFinder = new BiM.Behaviors.Game.World.Pathfinding.FFPathFinding.PathFinder(Map, false); Path path = null; if (pathFinder is IAdvancedPathFinder) path = (pathFinder as IAdvancedPathFinder).FindPath(Cell, cell, true, -1, minDistance, cautious); else path = pathFinder.FindPath(Cell, cell, true, -1); return Move(path, cell); }
public bool Move(short cellId, ISimplePathFinder pathFinder = null, int minDistance = 0, bool cautious = false, bool cancelMove = true) { if (CanMove()) return Move(Map.Cells[cellId], pathFinder, minDistance, cautious, cancelMove); return false; }