public Game(IMatchCondition matchCondition, int decks) { _matchCondition = matchCondition; _rdm = new Random(); _dealer = new Dealer(decks); _player1 = new Player("player 1"); _player2 = new Player("player 2"); }
public IMatchCondition <TInput> MatchesExact(TInput input) { foreach (IMatchCondition <TInput> child in m_matchConditions) { IMatchCondition <TInput> childMatch = child.MatchesExact(input); if (childMatch != null) { return(childMatch); } } return(null); }
public bool TryMatchExact(TInput input, out TOutput matchable, out IMatchCondition <TInput> exactMatch) { for (int i = 0; i < m_matchables.Length; i++) { IMatchCondition <TInput> cond = m_matchables[i].Condition.MatchesExact(input); if (cond != null) { matchable = m_matchables[i]; exactMatch = cond; return(true); } } matchable = default(TOutput); exactMatch = null; return(false); }
public WorkFlowContext SetCondition(IMatchCondition matchCondition) { this.Match = matchCondition; return(this); }