Ejemplo n.º 1
0
 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");
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public WorkFlowContext SetCondition(IMatchCondition matchCondition)
 {
     this.Match = matchCondition;
     return(this);
 }