TODO:
change literals to use constants,
refactor the rendering code for the menu to have be leaner.
add text scroller to list all the tasks.
* 1st implementation will list all the tasks.dat
* 2nd round will try to get the scroller to only display relevant tasks to ai
Special thanks to wololo and MootPoint for helping me hammer this out. To abrasax, for the initial design of the layout.
66 lines
1.2 KiB
C++
66 lines
1.2 KiB
C++
#ifndef _DECKMETADATA_H_
|
|
#define _DECKMETADATA_H_
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
#include "DeckStats.h"
|
|
|
|
|
|
using namespace std;
|
|
enum DECK_DIFFICULTY
|
|
{
|
|
HARD = -1,
|
|
NORMAL = 0,
|
|
EASY = 1
|
|
};
|
|
|
|
class DeckMetaData {
|
|
private:
|
|
string _filename;
|
|
|
|
string _desc;
|
|
string _name;
|
|
int _deckid;
|
|
string _avatarFilename;
|
|
|
|
// statistical information
|
|
|
|
int _nbGamesPlayed, _victories, _percentVictories, _difficulty;
|
|
|
|
public:
|
|
DeckMetaData();
|
|
DeckMetaData(string filename, Player * statsPlayer);
|
|
void load(string filename);
|
|
void loadStatsForPlayer( Player * statsPlayer, string opponentDeckName = "" );
|
|
|
|
// Accessors
|
|
string getFilename();
|
|
string getDescription();
|
|
string getName();
|
|
string getAvatarFilename();
|
|
string getStatsSummary();
|
|
|
|
int getDeckId();
|
|
int getGamesPlayed();
|
|
int getVictories();
|
|
int getVictoryPercentage();
|
|
int getDifficulty();
|
|
string getDifficultyString();
|
|
|
|
};
|
|
|
|
class DeckMetaDataList {
|
|
public:
|
|
void invalidate(string filename);
|
|
DeckMetaData * get(string filename, Player * statsPlayer = NULL);
|
|
~DeckMetaDataList();
|
|
static DeckMetaDataList * decksMetaData;
|
|
|
|
|
|
private:
|
|
map<string,DeckMetaData *>values;
|
|
};
|
|
|
|
#endif
|