Ejemplo n.º 1
0
 public void RollbackGame()
 {
     if (effectNum != 0 && !(state == MainState.Move || state == MainState.Wait))
     {
         return;
     }
     hint.ClearHints();
     board.RollbackGame(cache);
     storage.RollbackGame(cache);
     lastMove = cache.lastMove;
     lastMoveHint.Focus(lastMove);
     turn      = cache.descriptor.Turn;
     turnNum   = cache.turnNum;
     state     = MainState.Move;
     moveState = MoveState.Idle;
     _actionsCurrentTurn.Clear();
 }
Ejemplo n.º 2
0
    private void NewGame(GameMode gameMode)
    {
        this.gameMode = gameMode;

        lastMove  = null;
        moveState = MoveState.Idle;
        ClearEffect();
        hint.ClearHints();
        board.NewGame();
        storage.NewGame();
        state = MainState.Ready;
        turn  = Unit.OwnerEnum.Black;
        resultSprite.gameObject.SetActive(false);
        turnOverButton.gameObject.SetActive(false);

        if (gameMode != GameMode.Normal)
        {
            InitAI();
        }
        logger.Text  = "";
        logger.State = UILogger.StateEnum.Normal;
    }