예제 #1
0
        public EnhancedBoard(GamesBoard gb)
        {
            for (int c = 0; c < Constants.BOARDCOLSIZE; c++)
            {
                eBoard.Add(new List <EnhancedSquare>());
                for (int r = 0; r < Constants.BOARDROWSIZE; r++)
                {
                    EnhancedSquare tempESquare = new EnhancedSquare();
                    eBoard[c].Add(tempESquare);

                    board[c][r].boardSpace = gb.board[c][r].boardSpace;
                    board[c][r].northWall  = gb.board[c][r].northWall;
                    board[c][r].southWall  = gb.board[c][r].southWall;
                    board[c][r].westWall   = gb.board[c][r].westWall;
                    board[c][r].eastWall   = gb.board[c][r].eastWall;

                    eBoard[c][r].boardSpace = gb.board[c][r].boardSpace;
                    eBoard[c][r].northWall  = gb.board[c][r].northWall;
                    eBoard[c][r].southWall  = gb.board[c][r].southWall;
                    eBoard[c][r].westWall   = gb.board[c][r].westWall;
                    eBoard[c][r].eastWall   = gb.board[c][r].eastWall;
                }
            }
            this.prevDeco = gb;
        }
예제 #2
0
        public InnerWallBoard(GamesBoard gb, int colPosition, int rowPosition, CompassPoints wallSide)
        {
            for (int c = 0; c < Constants.BOARDCOLSIZE; c++)
            {
                for (int r = 0; r < Constants.BOARDROWSIZE; r++)
                {
                    board[c][r].boardSpace = gb.board[c][r].boardSpace;
                    board[c][r].northWall  = gb.board[c][r].northWall;
                    board[c][r].southWall  = gb.board[c][r].southWall;
                    board[c][r].westWall   = gb.board[c][r].westWall;
                    board[c][r].eastWall   = gb.board[c][r].eastWall;
                }
            }

            this.prevDeco = gb;
            switch (wallSide)
            {
            case CompassPoints.NORTH:
                gb.board[colPosition][rowPosition].northWall       = true;
                board[colPosition][rowPosition].northWall          = true;
                prevDeco.board[colPosition][rowPosition].northWall = true;
                break;

            case CompassPoints.SOUTH:
                gb.board[colPosition][rowPosition].southWall       = true;
                board[colPosition][rowPosition].southWall          = true;
                prevDeco.board[colPosition][rowPosition].southWall = true;
                break;

            case CompassPoints.WEST:
                gb.board[colPosition][rowPosition].westWall       = true;
                board[colPosition][rowPosition].westWall          = true;
                prevDeco.board[colPosition][rowPosition].westWall = true;
                break;

            case CompassPoints.EAST:
                gb.board[colPosition][rowPosition].eastWall       = true;
                board[colPosition][rowPosition].eastWall          = true;
                prevDeco.board[colPosition][rowPosition].eastWall = true;
                break;

            default:
                break;
            }
        }
예제 #3
0
 public BoardDecoration(GamesBoard gamesBoard)
 {
     this.prevDeco = gamesBoard;
 }