stats generation. No data needs to be written to the deck master files themselves. Now the mana colors will only show if you have battled with a particular deck at least once. This is not retroactive, so you will need to battle the ai again. This can not be edited manually either to prevent tampering with the statistical data. Player deck mana color display is also covered this way. Decks will still be saved in the new layout if a disk write is necessary. So any changes via the deck editor will result in a deck file rewrite is was always the case.:)
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
#include <string>
|
|
#include <vector>
|
|
|
|
#include "DeckMetaData.h"
|
|
|
|
using namespace std;
|
|
|
|
class DeckManager
|
|
{
|
|
private:
|
|
static bool instanceFlag;
|
|
static DeckManager *mInstance;
|
|
DeckManager()
|
|
{
|
|
//private constructor
|
|
}
|
|
|
|
public:
|
|
|
|
vector<DeckMetaData*> playerDeckOrderList;
|
|
vector<DeckMetaData*> aiDeckOrderList;
|
|
|
|
map<string, StatsWrapper*> playerDeckStatsMap;
|
|
map<string, StatsWrapper*> aiDeckStatsMap;
|
|
|
|
void updateMetaDataList(vector<DeckMetaData*>* refList, bool isAI);
|
|
vector<DeckMetaData*> * getPlayerDeckOrderList();
|
|
vector<DeckMetaData*> * getAIDeckOrderList();
|
|
|
|
void AddMetaData( const std::string& filename, bool isAI);
|
|
DeckMetaData* getDeckMetaDataById(int deckId, bool isAI);
|
|
DeckMetaData* getDeckMetaDataByFilename(const std::string& filename, bool isAI);
|
|
StatsWrapper* getExtendedStatsForDeckId(int deckId, MTGAllCards* collection, bool isAI);
|
|
StatsWrapper* getExtendedDeckStats(DeckMetaData* selectedDeck, MTGAllCards* collection, bool isAI);
|
|
|
|
static DeckManager* GetInstance();
|
|
static void EndInstance();
|
|
|
|
//convenience method to get the difficulty rating between two decks. This should be refined a little more
|
|
//since the eventual move of all deck meta data should be managed by this class
|
|
|
|
static int getDifficultyRating(Player *statsPlayer, Player *player);
|
|
|
|
~DeckManager();
|
|
|
|
};
|