public void ExecuteAction(AGameTurn gameTurn) { if (_currentGame.CanBePlayed(gameTurn)) { _currentGame.Play(gameTurn); } else { Debug.LogWarning("Can not play gameTurn " + gameTurn.GetType()); } }
public bool Play(AGameTurn action) { if (DiceGameState == DiceGameStates.Running && ((!(action is RerollTurn) || _currentBoard.IsRerollPossible()) && action.ValidateGameAction(this))) { action.PlayGameAction(this); CurrentBoard.CheckInstantRules(this); CheckRoundEnd(); CheckGameEnd(); if (_diceGameState == DiceGameStates.Running) { ActionEndedEvent?.Invoke(new GameTurnEndedEventArgs(this, action)); } return(true); } return(false); }
public GameTurnEndedEventArgs(DiceGame diceGame, AGameTurn gameTurn) { DiceGame = diceGame; GameTurn = gameTurn; }
public bool CanBePlayed(AGameTurn action) { return(action.ValidateGameAction(this)); }