Exemplo n.º 1
0
    private bool _gameModeChanged(GameMatchMode newMode, object changeStateData = null)
    {
        Debug.LogFormat("Update PlayField game mode From: {0} to {1}", _oldMatchMode, newMode);
        Assert.IsFalse(newMode == _oldMatchMode, "Should not be updating mode to the same state!");

        _oldMatchMode = newMode;

        switch (newMode)
        {
        case GameMatchMode.INITIAL:                    return(_initialState(changeStateData));

        case GameMatchMode.SHUFFLE_AND_REDISTRIBUTE:   return(_shuffleAndRedist(changeStateData));

        case GameMatchMode.PARTNER_TRADE:              return(_partnerTrade(changeStateData));

        case GameMatchMode.REDISTRIBUTE:               return(_redistribute(changeStateData));

        case GameMatchMode.PLAYER_TURN:                return(_playerTurn(changeStateData));

        case GameMatchMode.GAME_OVER:                  return(_gameOver(changeStateData));
        }

        Debug.LogErrorFormat("Could not change state to: {0}", newMode);
        return(false);
    }
Exemplo n.º 2
0
        public static ChangeMatchMode Create(TuckMatchState matchState, GameMatchMode newMode)
        {
            ChangeMatchMode command = new ChangeMatchMode();

            command.matchState   = matchState;
            command.newMatchMode = newMode;
            return(command);
        }
Exemplo n.º 3
0
    public void ApplyChangeMatchMode(GameMatchMode newMode)
    {
        ICommand command = ChangeMatchMode.Create(matchState, newMode);

        _commandFactory.Execute(command);
    }
Exemplo n.º 4
0
 private void _changeGameMatchMode(GameMatchMode mode)
 {
     _tuckMatchCore.ApplyChangeMatchMode(mode);
     _playFieldController.ChangeMatchMode(mode);
 }
Exemplo n.º 5
0
 public bool ChangeMatchMode(GameMatchMode m)
 {
     return(_gameModeChanged(m));
 }
Exemplo n.º 6
0
 public void Execute()
 {
     oldMatchMode             = matchState.gameMatchMode;
     matchState.gameMatchMode = newMatchMode;
 }