Beispiel #1
0
 private void OnDisable()
 {
     if (Debug.isDebugBuild)
     {
         QuickPlayTool.HideWindow();
     }
 }
Beispiel #2
0
 private void Awake()
 {
     _outcomeFinder = new OutcomeFinder();
     if (Debug.isDebugBuild)
     {
         QuickPlayTool.ShowWindow(CheatHandler, bigWin.PlayBigWinAnimation);
     }
     GetComponent <MenuController>().UpdatePlayerSymbolSelector(playerSymbols);
     gameBoard3x3.SetActive(false);
     gameBoard4x4.SetActive(false);
 }
Beispiel #3
0
 /**
  * Handler for 3x3 button click. Hides menu and shows/populates the 3x3 board.
  */
 public void OnSelect3x3Grid()
 {
     if (Debug.isDebugBuild)
     {
         QuickPlayTool.UpdateBoardSize(3);
     }
     gameBoard3x3.SetActive(true);
     gameBoard3x3.GetComponentInChildren <RibController>().AnimateRibs();
     gameBoard4x4.SetActive(false);
     GetComponent <MenuController>().MenuGrandExit();
     PopulateGameGrid(3, gameBoard3x3);
     StartNewGame(3);
 }
Beispiel #4
0
    private void CheatHandler(Dictionary <string, int> options)
    {
        Debug.Log("CheatHandler called");
        if (QuickPlayTool.GetBoardSize() == 4)
        {
            OnSelect4x4Grid();
        }
        else
        {
            OnSelect3x3Grid();
        }
        int player = options["whoWins"] == 0 ? 1 : -1;

        // start appropriate sequence of moves for selected game outcome.
        if (options["winType"] == 3)
        {
            _playbackMoves = _outcomeFinder.FindDrawGameSequence(_gameGrid.GetLength(0));
        }
        else if (options["winType"] == 2)
        {
            if (options["diagonalDir"] == 0)
            {
                _playbackMoves = _outcomeFinder.FindFirstDiagonalGameSequence(_gameGrid.GetLength(0), player);
            }
            else
            {
                _playbackMoves = _outcomeFinder.FindSecondDiagonalGameSequence(_gameGrid.GetLength(0), player);
            }
        }
        else if (options["winType"] == 0)
        {
            // row win
            _playbackMoves = _outcomeFinder.FindRowGameSequence(_gameGrid.GetLength(0), player, options["row"]);
        }
        else if (options["winType"] == 1)
        {
            // col win
            _playbackMoves = _outcomeFinder.FindColGameSequence(_gameGrid.GetLength(0), player, options["col"]);
        }
        _playbackIndex = 0;
        _onUpdate     += DoCheatMove;
    }