Ejemplo n.º 1
0
 public void Move(Vector move)
 {
     CurrentPosition = CurrentPosition + move;
 }
Ejemplo n.º 2
0
 internal void MoveBack(Vector move)
 {
     CurrentPosition = CurrentPosition - move;
 }
Ejemplo n.º 3
0
 public bool IsPossibleAndNotVisited(Vector position)
 {
     return position.X >= 0 && position.X < Board.DimensionX && position.Y >= 0 && position.Y < Board.DimensionY && !Board.Map[position.X, position.Y];
 }
Ejemplo n.º 4
0
 public bool IsPossible(Vector position)
 {
     return position.X >= 0 && position.X < Board.DimensionX && position.Y >= 0 && position.Y < Board.DimensionY;
 }
Ejemplo n.º 5
0
 //The optimalisation is needed for bigger boards. The possible moves are sorted
 //by the number of possible moves in the next step
 public IEnumerable<Vector> GetPossibleAndNotVisitedAndOrdered(Vector currentPosition)
 {
     return all
         .Where(x => IsPossibleAndNotVisited(x + currentPosition))
         .OrderBy(x => GetPossibleAndNotVisited(x + currentPosition).Count());
 }
Ejemplo n.º 6
0
 public IEnumerable<Vector> GetPossibleAndNotVisited(Vector currentPosition)
 {
     return all
         .Where(x => IsPossibleAndNotVisited(x + currentPosition));
 }
Ejemplo n.º 7
0
 public Knight(Vector initialCoordintates, Board board)
 {
     InitialPosition = initialCoordintates;
     CurrentPosition = initialCoordintates;
     Board = board;
 }