コード例 #1
0
 /// <summary>
 /// Initialize a square occupied by the piece.
 /// </summary>
 /// <param name="thePiece">Piece to occupy the square.</param>
 public ChessboardSquareModel(ChessPieceModel thePiece)
 {
     this.location = thePiece.Position;
     this.piece    = thePiece;
 }
コード例 #2
0
 /// <summary>
 /// Initialize an empty square.
 /// </summary>
 /// <param name="theLocation"></param>
 public ChessboardSquareModel(Point theLocation)
 {
     this.location = theLocation;
     this.piece    = new ChessPieceModel(theLocation, Player.White, PieceType.Empty);
 }
コード例 #3
0
 /// <summary>
 /// Create a chessboard square with a piece occupying it.
 /// </summary>
 /// <param name="thePiece">Piece.</param>
 /// <returns>Board square with a piece occupying it.</returns>
 public static ChessboardSquareModel CreateWith(ChessPieceModel thePiece)
 {
     return(new ChessboardSquareModel(thePiece));
 }