public void TestCheckIsMoveAvailable() { plateau = new Plateau(5, 5); coordinates = new Coordinates(1, 2); bool flag = plateauService.CheckIsMoveAvailable(plateau, coordinates, Direction.East); Assert.IsTrue(flag); }
private void ApplyMoveCommand(Rover rover) { if (plateauService.CheckIsMoveAvailable(rover.plateau, rover.coordinates, rover.direction)) { switch (rover.direction) { case Direction.North: rover.coordinates.yCoordinate = rover.coordinates.yCoordinate + 1; break; case Direction.West: rover.coordinates.xCoordinate = rover.coordinates.xCoordinate - 1; break; case Direction.South: rover.coordinates.yCoordinate = rover.coordinates.yCoordinate - 1; break; default: rover.coordinates.xCoordinate = rover.coordinates.xCoordinate + 1; break; } return; } return; }