public virtual void Move(Direction direction) { var move = Pathfinding.DirectionToPoint(direction); var newposition = Position + move; position = newposition; }
protected virtual bool IsWallInDirection(Direction direction) { var objects = GameScreen.miniConsole.GetAllObjectsAtPoint(Pathfinding.DirectionToPoint(direction) + Position); foreach (var item in objects) { if (item is Wall && !(item is RangeWall)) { return(true); } } return(false); }
public override void Move(Direction direction) { var move = Pathfinding.DirectionToPoint(direction); var newposition = Position + move; if (Pathfinding.IsPointInBFSList(newposition, MoveArea)) { if (!moverun) { moverun = true; startpoint = position; } position = newposition; } }
protected override bool IsWallInDirection(Direction direction) { return(GameScreen.miniConsole.IsRangeWallAtPoint(Pathfinding.DirectionToPoint(direction) + Position)); }