Jeck - Added custom booster packs (see miki), numerous small fixes. Once we hit feature-freeze I'll be reviewing this stuff in depth, as again there's likely a lot of room for cleaning... just wanted to get it in first :).

I cut some bits out that weren't ready for SVN, hopefully I've committed everything correctly.
This commit is contained in:
wagic.jeck
2010-02-11 18:32:44 +00:00
parent 103a3d2822
commit ab34fc16f9
31 changed files with 1013 additions and 134 deletions
+79
View File
@@ -0,0 +1,79 @@
#ifndef _MTGPACCK_H_
#define _MTGPACK_H_
class MTGPackEntry{
public:
virtual int addCard(WSrcCards * pool,MTGDeck * to) = 0;
int copies;
};
class MTGPackEntryRandom: public MTGPackEntry{
public:
int addCard(WSrcCards * pool,MTGDeck * to);
string filter;
};
class MTGPackEntrySpecific: public MTGPackEntry{
public:
int addCard(WSrcCards * pool,MTGDeck * to);
MTGCard * card;
};
class MTGPackEntryNothing: public MTGPackEntry{
public:
int addCard(WSrcCards * pool,MTGDeck * to) {return 0;};
};
class MTGPackSlot{
public:
~MTGPackSlot();
int add(WSrcCards * ocean, MTGDeck * to, int carryover);
void addEntry(MTGPackEntry*item);
int copies;
string pool;
vector<MTGPackEntry*> entries;
};
class MTGPack{
public:
friend class MTGPacks;
bool meetsRequirements(); //Check if pool contains locked cards.
bool isUnlocked();
bool isValid() {return bValid;};
void load(string filename);
int assemblePack(MTGDeck * to);
MTGPack(string s) {bValid = false; load(s); unlockStatus=0;};
~MTGPack();
string getName();
string getSort() {return sort;};
int getPrice() {return price;};
static WSrcCards * getPool(string poolstr);
protected:
void countCards();
string name; //Name of the pack.
string type; //"Booster", "Deck", "Whatever"
string pool; //The starting pool.
string sort; //The sorting method.
string check; //Unlock requirements.
string desc; //Big card description.
bool bValid;
int unlockStatus;
int price; //Base price.
int minCards, maxCards;
vector<MTGPackSlot*> slots;
};
class MTGPacks{
public:
~MTGPacks();
MTGPack * randomPack(int key=0);
void loadAll();
int size() {return (int)packs.size();};
void refreshUnlocked();
private:
vector<MTGPack*> packs;
};
#endif