class CardEffect;
struct Card
{
Card()
{
effect = NULL;
}
String PrettyName() const
{
String result = name;
result[0] = toupper(name[0]);
return " " + result + " ";
}
bool IsPureVictory() const
{
return (isVictory && !isTreasure && !isAction && !isDuration);
}
String name;
int cost;
int supply;
bool isVictory;
bool isTreasure;
bool isAction;
bool isReaction;
bool isDuration;
bool isAttack;
bool isPermanent;
int actions;
int cards;
int buys;
int money;
int victoryTokens;
int victoryPoints;
int treasure;
CardEffect *effect;
String expansion;
int priority;
int strength;
};
class CardDatabase
{
public:
void Init(bool useCustomCards);
Card* GetCard(const String &s) const;
Card* RandomSupplyCard() const;
private:
void RegisterCardEffects(bool useCustomCards);
void RegisterCard(const String &cardName, CardEffect *effect);
void LoadCardList(const String &filename, const String &expansion);
bool IsSupplyCard(const Card *c) const;
void LoadPriorityList();
void LoadStrengthList();
map<String, Card*> _cards;
Vector<Card*> _cardList;
Vector<String> _skipList;
};