예제 #1
0
 public void Place(TakPiece piece)
 {
     if (Size != 0)
     {
         throw new Exception("Cannot place a piece on a non-empty stack");
     }
     else
     {
         Pieces.Add(piece);
     }
 }
예제 #2
0
        private void ApplyPlace(GameState game)
        {
            TakPiece piece;

            if (Piece == TakPiece.PieceType.Capstone)
            {
                game[PieceColor].NumCapstones--;
                piece = new Capstone(PieceColor);
            }
            else
            {
                game[PieceColor].NumPieces--;
                piece = new TakPiece(PieceColor)
                {
                    IsWall = Piece == TakPiece.PieceType.Wall
                };
            }

            game.Board[Row, Column].Place(piece);
        }
예제 #3
0
 public TakPiece(TakPiece src)
 {
     Color  = src.Color;
     IsWall = src.IsWall;
 }