HoldemHand.Hand.IsSuited C# (CSharp) Method

IsSuited() public static method

This function returns true if the cards in the mask are all one suit. This method calculates the results. Because of the equivelent call in PocketHands is preferred because it uses a lookup table and is faster. This function remains to allow for automated testing.
public static IsSuited ( ulong mask ) : bool
mask ulong mask to check for "suited-ness"
return bool
        public static bool IsSuited(ulong mask)
        {
            int cards = BitCount(mask);

            uint sc = CardMask(mask, Clubs);
            uint sd = CardMask(mask, Diamonds);
            uint sh = CardMask(mask, Hearts);
            uint ss = CardMask(mask, Spades);

            return  BitCount(sc) == cards || BitCount(sd) == cards ||
                    BitCount(sh) == cards || BitCount(ss) == cards;
        }