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); }
public static ChangeMatchMode Create(TuckMatchState matchState, GameMatchMode newMode) { ChangeMatchMode command = new ChangeMatchMode(); command.matchState = matchState; command.newMatchMode = newMode; return(command); }
public void ApplyChangeMatchMode(GameMatchMode newMode) { ICommand command = ChangeMatchMode.Create(matchState, newMode); _commandFactory.Execute(command); }
private void _changeGameMatchMode(GameMatchMode mode) { _tuckMatchCore.ApplyChangeMatchMode(mode); _playFieldController.ChangeMatchMode(mode); }
public bool ChangeMatchMode(GameMatchMode m) { return(_gameModeChanged(m)); }
public void Execute() { oldMatchMode = matchState.gameMatchMode; matchState.gameMatchMode = newMatchMode; }