Beispiel #1
0
 static BoardSquareWalls()
 {
     top_wall_data          = new BoardSquareWalls(Move.up());
     bottom_wall_data       = new BoardSquareWalls(Move.down());
     left_wall_data         = new BoardSquareWalls(Move.left());
     right_wall_data        = new BoardSquareWalls(Move.right());
     top_left_wall_data     = new BoardSquareWalls(Move.left(), Move.up());
     top_right_wall_data    = new BoardSquareWalls(Move.right(), Move.up());
     bottom_left_wall_data  = new BoardSquareWalls(Move.left(), Move.down());
     bottom_right_wall_data = new BoardSquareWalls(Move.right(), Move.down());
     empty_wall_data        = new BoardSquareWalls();
 }
Beispiel #2
0
        public void add_walls()
        {
            //Set all walls to empty first

            foreach (var i in board_data)
            {
                foreach (var j in i)
                {
                    ((BoardSquare)j).walls = BoardSquareWalls.empty_wall();
                }
            }

            //Add walls, which will replace some of the empty walls.
            //left wall
            for (int i = 1; i <= 8; i++)
            {
                ((BoardSquare)board_data[0][i]).walls = BoardSquareWalls.left_wall();
            }
            //right wall
            for (int i = 1; i <= 8; i++)
            {
                ((BoardSquare)board_data[9][i]).walls = BoardSquareWalls.right_wall();
            }
            //bottom wall
            for (int i = 1; i <= 8; i++)
            {
                ((BoardSquare)board_data[i][0]).walls = BoardSquareWalls.bottom_wall();
            }
            //above wall
            for (int i = 1; i <= 8; i++)
            {
                ((BoardSquare)board_data[i][9]).walls = BoardSquareWalls.top_wall();
            }

            ((BoardSquare)board_data[0][0]).walls = BoardSquareWalls.bottom_left_wall();
            ((BoardSquare)board_data[9][9]).walls = BoardSquareWalls.top_right_wall();
            ((BoardSquare)board_data[0][9]).walls = BoardSquareWalls.top_left_wall();
            ((BoardSquare)board_data[9][0]).walls = BoardSquareWalls.bottom_right_wall();
        }