private PassportCards GetNextEnumValue(PassportCards current) { PassportCards[] Arr = (PassportCards[])Enum.GetValues(current.GetType()); int j = Array.IndexOf(Arr, current) + 1; return(Arr[j]); }
// returns true if all attacking cards are passport public bool AllPassport(PassportCards passport) { foreach (Card card in attackingCards) { if ((int)card.rank != (int)passport) { return(false); } } return(true); }