- Displaying title for each page - In screen showing games against AI, displaying actual number of games won/played in addition to percentage - Added two new screens (3,4) - mana cost/color breakdown for creatures (3) and non-creature spells (4) More to come...
40 lines
887 B
C++
40 lines
887 B
C++
#ifndef _DECKSTATS_H_
|
|
#define _DECKSTATS_H_
|
|
|
|
|
|
#include <map>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
class Player;
|
|
class GameObserver;
|
|
|
|
class DeckStat{
|
|
public:
|
|
int nbgames;
|
|
int victories;
|
|
DeckStat(int _nbgames = 0 , int _victories = 0):nbgames(_nbgames),victories(_victories){};
|
|
int percentVictories();
|
|
};
|
|
|
|
class DeckStats{
|
|
protected:
|
|
static DeckStats * mInstance;
|
|
public:
|
|
map<string, DeckStat *>stats;
|
|
static DeckStats * GetInstance();
|
|
void saveStats(Player * player, Player * opponent, GameObserver * game);
|
|
void save(const char * filename);
|
|
void save(Player * player);
|
|
void load(const char * filename);
|
|
void load(Player * player);
|
|
void cleanStats();
|
|
~DeckStats();
|
|
int percentVictories(string opponentsDeckFile);
|
|
int percentVictories();
|
|
DeckStat * getDeckStat(string opponentsFile);
|
|
int nbGames();
|
|
};
|
|
|
|
#endif
|