- removed every references to the gameobserver singleton. This object can now be instantiated several times as it's needed for minmax. To be able to do that, I mostly added a reference to a gameobserver from any targetable object (cards, players, spells) and abilities.
59 lines
1.3 KiB
C++
59 lines
1.3 KiB
C++
#ifndef _CREDITS_H_
|
|
#define _CREDITS_H_
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <JGE.h>
|
|
#include "WFont.h"
|
|
#include <time.h>
|
|
#include "Player.h"
|
|
|
|
class GameApp;
|
|
class DeckStats;
|
|
|
|
using namespace std;
|
|
|
|
class CreditBonus
|
|
{
|
|
public:
|
|
int value;
|
|
string text;
|
|
CreditBonus(int _value, string _text);
|
|
void Render(float x, float y, WFont * font);
|
|
};
|
|
|
|
class Credits
|
|
{
|
|
private:
|
|
time_t gameLength;
|
|
int isDifficultyUnlocked(DeckStats * stats);
|
|
int isMomirUnlocked();
|
|
int isStoneHewerUnlocked();
|
|
int isHermitUnlocked();
|
|
int isEvilTwinUnlocked();
|
|
int isRandomDeckUnlocked();
|
|
int IsMoreAIDecksUnlocked(DeckStats * stats);
|
|
string unlockedTextureName;
|
|
JQuadPtr GetUnlockedQuad(string texturename);
|
|
public:
|
|
int value;
|
|
Player * p1, *p2;
|
|
GameObserver* observer;
|
|
GameApp * app;
|
|
int showMsg;
|
|
int unlocked;
|
|
string unlockedString;
|
|
vector<CreditBonus *> bonus;
|
|
Credits();
|
|
~Credits();
|
|
void compute(GameObserver* observer, GameApp * _app);
|
|
void Render();
|
|
static int unlockRandomSet(bool force = false);
|
|
static int unlockSetByName(string name);
|
|
static int addCreditBonus(int value);
|
|
static int addCardToCollection(int cardId, MTGDeck * collection);
|
|
static int addCardToCollection(int cardId);
|
|
};
|
|
|
|
#endif
|