Ejemplo n.º 1
0
 public void AddPiece(Piece piece, BoardCoordinate location)
 {
     if (location.IsValidForBoard(BoardSize))
     {
         if (!_pieces.ContainsKey(location))
         {
             _pieces.Add(location, piece);
         }
         else
         {
             throw new InvalidOperationException("BoardCoordinate Is Occupied");
         }
     }
     else
     {
         throw new InvalidOperationException("BoardCoordinate Is Out Of Range");
     }
 }
Ejemplo n.º 2
0
 public static MoveResult Captured(Piece captured)
 {
     return new MoveResult(true, captured);
 }
Ejemplo n.º 3
0
 private MoveResult(bool success, Piece captured = null)
 {
     _success = success;
     _captured = captured;
 }
Ejemplo n.º 4
0
 public void Setup()
 {
     _board = new Board(8);
     _startingLocation = new BoardCoordinate(1, 1);
     _piece = new Bishop(PlayerColor.White);
 }