Example #1
0
        public override string ToString()
        {
            string desc = "Placed: " + numPlaced + ", Available: ";

            if (availableCardMask > 0)
            {
                for (int Idx = 0; Idx < maxAvailableCards; Idx++)
                {
                    bool bIsAvailable = (availableCardMask & (1 << Idx)) != 0;
                    if (bIsAvailable)
                    {
                        TriadCard card = GetCard(Idx);
                        desc += card.ToShortCodeString() + ", ";
                    }
                }

                desc = desc.Remove(desc.Length - 2, 2);
            }
            else
            {
                desc += "none";
            }

            return(desc);
        }
Example #2
0
        public override string ToString()
        {
            string desc = "[SCREEN] Available: ";

            if (availableCardMask > 0)
            {
                for (int Idx = 0; Idx < cards.Length; Idx++)
                {
                    bool bIsAvailable = (availableCardMask & (1 << Idx)) != 0;
                    if (bIsAvailable)
                    {
                        TriadCard card = GetCard(Idx);
                        desc += (card != null ? card.Name.GetCodeName() : "") + (Idx == swappedCardIdx ? ":SWAP" : "") + ", ";
                    }
                }

                desc = desc.Remove(desc.Length - 2, 2);
            }
            else
            {
                desc += "none";
            }

            int  visibleCardsMask = (cards != null) ? ((1 << cards.Length) - 1) : 0;
            bool hasHiddenCards   = (availableCardMask & ~visibleCardsMask) != 0;

            if (hasHiddenCards)
            {
                desc += ", Unknown: ";
                if (deck != null)
                {
                    for (int Idx = cards.Length; Idx < maxAvailableCards; Idx++)
                    {
                        bool bIsAvailable = (availableCardMask & (1 << Idx)) != 0;
                        if (bIsAvailable)
                        {
                            TriadCard card         = GetCard(Idx);
                            bool      bIsKnownPool = (unknownPoolMask & (1 << Idx)) == 0;
                            desc += card.ToShortCodeString() + ":" + Idx + ":" + (bIsKnownPool ? "K" : "U") + (Idx == swappedCardIdx ? ":SWAP" : "") + ", ";
                        }
                    }

                    desc = desc.Remove(desc.Length - 2, 2);
                }
                else
                {
                    desc += "(missing deck!)";
                }
            }

            return(desc);
        }
 public override string ToString()
 {
     return(card.ToShortCodeString() + ", score: " + score);
 }