HoldemHand.Hand.OutCards C# (CSharp) Method

OutCards() public static method

Returns a string of the possible outs for the next card. Note that cards that only help the board will be ignored.
public static OutCards ( string player, string board ) : string
player string Player pocket card string
board string Board card string
return string
        public static string OutCards(string player, string board, params string[] opponents)
        {
            if (!Hand.ValidateHand(player) && Hand.BitCount(Hand.ParseHand(player)) != 2) throw new ArgumentException("player");
            if (!Hand.ValidateHand(board) && Hand.BitCount(Hand.ParseHand(board)) != 3 && Hand.BitCount(Hand.ParseHand(board)) != 4) throw new ArgumentException("board");

            ulong[] opponentsMask = new ulong[opponents.Length];
            for (int i = 0; i < opponents.Length; i++)
            {
                if (!Hand.ValidateHand(opponents[i]) && Hand.BitCount(Hand.ParseHand(opponents[i])) != 2) throw new ArgumentException("opponents");
                opponentsMask[i] = Hand.ParseHand(opponents[i]);
            }

            ulong mask = OutsMask(Hand.ParseHand(player), Hand.ParseHand(board), opponentsMask);

            string retval = "";
            foreach (string s in Cards(mask))
            {
                if (retval.Length == 0)
                    retval = s;
                else
                    retval += " " + s;
            }

            return retval;
        }