/// <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; }
/// <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); }
/// <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)); }