Esempio n. 1
0
 private void GenerateBoxes()
 {
     for (int row = 0; row < BlackboxConfig.GameBoardRow; row++)
     {
         for (int column = 0; column < BlackboxConfig.GameBoardColumn; column++)
         {
             if ((row == 0) ||
                 (column == 0) ||
                 (row == BlackboxConfig.GameBoardRow - 1) ||
                 (column == BlackboxConfig.GameBoardColumn - 1))
             {
                 if ((row > 0) && (row < BlackboxConfig.GameBoardRow - 1) ||
                     (column > 0) && (column < BlackboxConfig.GameBoardColumn - 1))
                 {
                     _boxes[row, column]       = new LightBox(this, row, column);
                     _boxes[row, column].State = LightBox.ConcealState;
                 }
                 else
                 {
                     _boxes[row, column]       = new NookBox(this, row, column);
                     _boxes[row, column].State = NookBox.NookState;
                 }
                 continue;
             }
             _boxes[row, column]       = new BlackBox(this, row, column);
             _boxes[row, column].State = BlackBox.GuessNoneState;
         }
     }
 }
Esempio n. 2
0
        public Rays(LightBox lightBox)
        {
            _visible = false;

            _lightBox = lightBox;

            BuildRays();

            _lightSpot = new LightSpot();

            this.timer          = new DispatcherTimer();
            this.timer.Interval = TimeSpan.FromMilliseconds(50);
            this.timer.Tick    += new EventHandler(timer_Tick);
        }
Esempio n. 3
0
        public Rays(LightBox lightBox)
        {
            _visible = false;

            _lightBox = lightBox;

            BuildRays();

            _lightSpot = new LightSpot();

            this.timer = new DispatcherTimer();
            this.timer.Interval = TimeSpan.FromMilliseconds(50);
            this.timer.Tick += new EventHandler(timer_Tick);
        }
Esempio n. 4
0
 private void GenerateBoxes()
 {
     for (int row = 0; row < BlackboxConfig.GameBoardRow; row++)
     {
         for (int column = 0; column < BlackboxConfig.GameBoardColumn; column++)
         {
             if ((row == 0) ||
                 (column == 0) ||
                 (row == BlackboxConfig.GameBoardRow - 1) ||
                 (column == BlackboxConfig.GameBoardColumn - 1))
             {
                 if ((row > 0) && (row < BlackboxConfig.GameBoardRow - 1) ||
                     (column > 0) && (column < BlackboxConfig.GameBoardColumn - 1))
                 {
                     _boxes[row, column] = new LightBox(this, row, column);
                     _boxes[row, column].State = LightBox.ConcealState;
                 }
                 else
                 {
                     _boxes[row, column] = new NookBox(this, row, column);
                     _boxes[row, column].State = NookBox.NookState;
                 }
                 continue;
             }
             _boxes[row, column] = new BlackBox(this, row, column);
             _boxes[row, column].State = BlackBox.GuessNoneState;
         }
     }
 }