Example #1
0
        /// <summary>
        /// Description of the card.
        /// </summary>
        /// <returns>String with the card inf</returns>
        public override string ToString()
        {
            string value = "{0} {1}";

            switch (Color)
            {
            case CardColor.Purple:
                value = String.Format(value, ToStringShort(), Face);
                break;

            case CardColor.Wildcard:
                value = String.Format(value, ToStringShortColor(), Face.ToString());
                break;

            case CardColor.Red:
            case CardColor.Yellow:
            case CardColor.Blue:
            case CardColor.Green:
            case CardColor.Bionic:
                // Normal format.
                value = String.Format(value,
                                      Color.ToString(),
                                      Face.ToString());
                break;
            }

            return(value);
        }
Example #2
0
        public RepairAction(CardFace face, CriticalCardType?type = null)
        {
            damageCardFace   = face;
            criticalCardType = type;

            DiceModificationName = Name = "Repair 1 " + face.ToString().ToLower() + (type != null ? " " + type.ToString() : "") + " damage";
        }
Example #3
0
        private string CheckCardFace(CardFace cardFace)
        {
            string result = "";

            if ((int)cardFace <= 10)
            {
                return result = ((int)cardFace).ToString();
            }
            else
            {
                string cardName = cardFace.ToString();
                char firstLetter = cardName[0];
                return result = firstLetter.ToString();
            }
        }
Example #4
0
 public override string ToString()
 {
     return("Suite: " + suite.ToString() + "; Face: " + face.ToString());
 }
Example #5
0
 /// <summary>
 /// to string override to represent a card on console.
 /// </summary>
 /// <returns>cardface of suit</returns>
 public override string ToString()
 {
     return(cardFace.ToString() + " of " + suit.ToString());
 }
Example #6
0
 /// <summary>Overridden ToString() function</summary>
 /// <returns>String representation of a Card</returns>
 public override string ToString()
 {
     return("[" + suit.ToString() + face.ToString() + "]");
 }
Example #7
0
        public override string ToString()
        {
            var newString = ($"[{CardFace.ToString()}, {Suit.ToString()}]");

            return(newString);
        }
Example #8
0
 // Constructor for a Card
 public Card(CardFace face, CardSuit suit)
 {
     Face  = face;
     Suit  = suit;
     Image = Face.ToString() + Suit + ".jpg";
 }