예제 #1
0
        /// <summary>
        /// Determines whether the given symbols meet the minimum requirements for a match.
        /// </summary>
        /// <remarks>
        /// A PayCombo could be defined as { AA, AA, AA }. In order to match this PayCombo,
        /// the given symbols in the payline must have at least 3 x AA in it.
        /// </remarks>
        /// <returns><c>true</c> if this instance matches the specified symbols; otherwise, <c>false</c>.</returns>
        /// <param name="symbolComparer">Reference to the symbol comparer.</param>
        /// <param name="symbolsInPayline">The symbols to match.</param>
        public bool IsMatch(ISymbolComparer symbolComparer, List <Symbol> symbolsInPayline)
        {
            // Cannot match if the PayCombo requires more symbols than we are given.
            if (SymbolsInPayCombo.Count > symbolsInPayline.Count)
            {
                return(false);
            }

            bool match = true;

            for (int i = 0; i < SymbolsInPayCombo.Count; ++i)
            {
                if (!symbolComparer.Match(SymbolsInPayCombo [i], symbolsInPayline [i]))
                {
                    match = false;
                    break;
                }
            }

            return(match);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PayComboGroup"/> class.
 /// </summary>
 public PayComboGroup(ISymbolComparer symbolComparer)
 {
     Combos         = new List <PayCombo> ();
     SymbolComparer = symbolComparer;
 }