/// <summary> /// Check card values to determine if they are right (i.e. are into allowed range for each property) /// </summary> /// <param name="_type">Card type as enum</param> /// <param name="_class">Card class as enum</param> /// <param name="_set">Card set as enum</param> /// <param name="_race">Card race as enum</param> /// <param name="_quality">Card quality as enum</param> /// <returns></returns> public static CardError checkCard(CardType _type, CardClass _class, CardSet _set, CardRace _race, CardQuality _quality, string _name) { if ((_type < CardType.Minion) || (_type > CardType.Weapon)) { return CardError.BadType; } // Wrong card class? if ((_class < CardClass.Neutral) || (_class > CardClass.Druid)) { return CardError.BadClass; } // Wrong card set? if ((_set < CardSet.Basic) || (_set > CardSet.WhispersOfTheOldGods)) { return CardError.BadSet; } // Wrong minion race? if ((_type == CardType.Minion) && ((_race < CardRace.None) || (_race > CardRace.Pirate))) { return CardError.BadRace; } // Wrong card quality? if ((_quality < CardQuality.Free) || (_quality > CardQuality.Legendary)) { return CardError.BadQuality; } // Wrong (empty) name? if (_name.Length == 0) { return CardError.BadName; } return CardError.None; }
public CollectedCard(string id, string name, CardQuality cardQuality, bool foil, int multiverseId, string setCode, string setName) : base(name) { Id = id; CardQuality = cardQuality; Foil = foil; MultiverseId = multiverseId; SetCode = setCode; SetName = setName; }
public CollectedCard(Guid id, Card card, CardQuality cardQuality, bool foil) : this(id.ToString(), card.Name, cardQuality, foil, card.MultiverseId, card.Set.Code, card.Set.Name) { }
public Card(CardSuit suit, CardQuality quality) { this.suit = suit; this.quality = quality; }
public Card() { suit = CardSuit.Count; quality = CardQuality.Count; }