- It is now possible to have avatars associated to each Deck - Added SFX - Added Music files - Possibility to choose your opponent - Opponents' difficulty is measured according to their number of victories against a given deck
36 lines
791 B
C++
36 lines
791 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);
|
|
};
|
|
|
|
#endif |