public void SetAction(Stage stage, int playerId, ActionType action, int amount) { CheckUpdateStage(stage); var player = _players[playerId]; var playerAction = new PokerActionHistory(stage, action, amount); player.SetAction(playerAction); switch (action) { case ActionType.Blind: case ActionType.Fold: case ActionType.Check: case ActionType.Call: case ActionType.Raise: _actions.Add(new HandAction(player.Player, playerAction)); //player.SetAction(pAction); break; case ActionType.Show: break; case ActionType.Win: break; default: throw new ArgumentOutOfRangeException(nameof(action), action, null); } }
public void SetAction(PokerActionHistory action) { if (action.Stage != _currentStage) { throw new ArgumentException($"{nameof(action)} does not match the current stage", nameof(action)); } HandActions.Add(action); StageActions.Add(action); switch (action.Action) { case ActionType.Blind: case ActionType.Call: case ActionType.Raise: TotalStageBet += action.Amount; break; } }