Exemple #1
0
 public void Move(Vector move)
 {
     CurrentPosition = CurrentPosition + move;
 }
Exemple #2
0
 internal void MoveBack(Vector move)
 {
     CurrentPosition = CurrentPosition - move;
 }
Exemple #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];
 }
Exemple #4
0
 public bool IsPossible(Vector position)
 {
     return position.X >= 0 && position.X < Board.DimensionX && position.Y >= 0 && position.Y < Board.DimensionY;
 }
Exemple #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());
 }
Exemple #6
0
 public IEnumerable<Vector> GetPossibleAndNotVisited(Vector currentPosition)
 {
     return all
         .Where(x => IsPossibleAndNotVisited(x + currentPosition));
 }
Exemple #7
0
 public Knight(Vector initialCoordintates, Board board)
 {
     InitialPosition = initialCoordintates;
     CurrentPosition = initialCoordintates;
     Board = board;
 }