This btw points out another circular dependancy between the texture and the JQuad - a texture owns a bunch of JQuads, yet the renderer uses JQuads and always assumes that the texture is valid. We're going to need to add more defensiveness to JGE to protect against this. Other changes in this check-in: WResourceManager doesn't derive from JResourceManager anymore. It actually didn't require anything from the base, so I killed the dependency. Also cleaned up the notion of a WTrackedQuad in the WCachedResource - it didn't need a separate class, just a better container. I've build this & tested against PSP, win, linux, QT (linux). I haven't tried against iOS and QT Win, or Maemo. If these other platforms are broken, I apologize in advance! - I'm hoping it should be fairly simple to put them back into play.
121 lines
2.2 KiB
C++
121 lines
2.2 KiB
C++
#ifndef _PLAYER_H_
|
|
#define _PLAYER_H_
|
|
|
|
#include "JGE.h"
|
|
#include "MTGGameZones.h"
|
|
#include "Damage.h"
|
|
#include "Targetable.h"
|
|
|
|
class MTGDeck;
|
|
class MTGPlayerCards;
|
|
class MTGInPlay;
|
|
class ManaPool;
|
|
|
|
class Player: public Damageable
|
|
{
|
|
protected:
|
|
ManaPool * manaPool;
|
|
|
|
public:
|
|
enum ENUM_PLAY_MODE
|
|
{
|
|
MODE_TEST_SUITE,
|
|
MODE_HUMAN,
|
|
MODE_AI
|
|
};
|
|
|
|
JTexture * mAvatarTex;
|
|
JQuadPtr mAvatar;
|
|
int playMode;
|
|
bool canPutLandsIntoPlay;
|
|
int landsPlayerCanStillPlay;
|
|
bool nomaxhandsize;
|
|
int castedspellsthisturn;
|
|
bool onlyonecast;
|
|
int castcount;
|
|
bool nocreatureinstant;
|
|
bool nospellinstant;
|
|
bool onlyoneinstant;
|
|
bool castrestrictedcreature;
|
|
bool castrestrictedspell;
|
|
bool onlyoneboth;
|
|
bool bothrestrictedspell;
|
|
bool bothrestrictedcreature;
|
|
bool isPoisoned;
|
|
MTGPlayerCards * game;
|
|
string deckFile;
|
|
string deckFileSmall;
|
|
string deckName;
|
|
|
|
Player(MTGDeck * deck, string deckFile, string deckFileSmall);
|
|
virtual ~Player();
|
|
|
|
virtual void End();
|
|
virtual int displayStack()
|
|
{
|
|
return 1;
|
|
}
|
|
const string getDisplayName() const;
|
|
int typeAsTarget()
|
|
{
|
|
return TARGET_PLAYER;
|
|
}
|
|
|
|
int afterDamage();
|
|
|
|
int gainLife(int value);
|
|
int loseLife(int value);
|
|
int gainOrLoseLife(int value);
|
|
|
|
int poisoned();
|
|
int damaged();
|
|
int prevented();
|
|
void unTapPhase();
|
|
MTGInPlay * inPlay();
|
|
ManaPool * getManaPool();
|
|
void takeMulligan();
|
|
|
|
void cleanupPhase();
|
|
virtual int Act(float dt)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
virtual int isAI()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
Player * opponent();
|
|
int getId();
|
|
JQuadPtr getIcon();
|
|
|
|
virtual int receiveEvent(WEvent * event)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
virtual void Render()
|
|
{
|
|
}
|
|
|
|
void loadAvatar(string file);
|
|
|
|
/**
|
|
** Returns the path to the stats file of currently selected deck.
|
|
*/
|
|
std::string GetCurrentDeckStatsFile();
|
|
};
|
|
|
|
class HumanPlayer: public Player
|
|
{
|
|
public:
|
|
HumanPlayer(MTGDeck * deck, string deckFile, string deckFileSmall);
|
|
HumanPlayer(string deckFile);
|
|
|
|
};
|
|
|
|
ostream& operator<<(ostream&, const Player&);
|
|
|
|
#endif
|