//Sets the piece variable isInPlay to false public void Remove(Pair pos) { GetChessPiece(pos).Remove(); }
//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; }