Exemple #1
0
 //Sets the piece variable isInPlay to false
 public void Remove(Pair pos)
 {
     GetChessPiece(pos).Remove();
 }
Exemple #2
0
 //Get a chess piece given a position
 public ChessPiece GetChessPiece(Pair pos)
 {
     foreach (ChessPiece piece in AllPieces)
     {
         if (piece.Position.Equals(pos))
         {
             return piece;
         }
     }
     throw new ArgumentOutOfRangeException("GetChessPiece failed, no piece at position: (" + pos.Horizontal + ", " + pos.Vertical + ")");
     //return null;
 }