private PlayerAction GetTurnChain(PlayerTurnContext context) { var decisionContext = new DecisionMakingContext() { ActionChoser = ActionChoser, CardChoser = CardChoser, MyCards = this.Cards, Tracker = Tracker, TurnContext = context, Validator = this.PlayerActionValidator }; // TODO: this of something more elegant var action = decisionMaker.Handle(decisionContext); switch (action.Type) { case PlayerActionType.PlayCard: return(this.PlayCard(action.Card)); case PlayerActionType.ChangeTrump: return(this.ChangeTrump(context.TrumpCard)); case PlayerActionType.CloseGame: return(this.CloseGame()); default: throw new InvalidOperationException("Invalid type of player action"); } }
public void Dispose() { if (_dmContext != null) { _dmContext.Dispose(); _dmContext = null; } }
public ModelingEstimator(OpponentModeling oppModelling, PokerClient pokerClient) { _opponentModeling = oppModelling; _pokerClient = pokerClient; _dmContext = new DecisionMakingContext(); }