Files
wagic/projects/mtg/include/PlayRestrictions.h
Xawotihs@gmail.com eec9bb44a8 Fixed warnings from linux and Android compilers
Cleaned up network code on Linux, it still does not work correctly
2013-01-26 22:17:43 +00:00

57 lines
1.1 KiB
C++

#ifndef _PLAY_RESTRICTIONS_H_
#define _PLAY_RESTRICTIONS_H_
class TargetChooser;
class MTGCardInstance;
class MTGGameZone;
class PlayRestriction
{
public:
enum
{
CAN_PLAY,
CANT_PLAY,
NO_OPINION
};
TargetChooser * tc;
virtual int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone) = 0;
PlayRestriction(TargetChooser * tc);
virtual ~PlayRestriction();
};
class MaxPerTurnRestriction: public PlayRestriction
{
public:
enum
{
NO_MAX = -1,
};
int maxPerTurn;
MTGGameZone * zone;
MaxPerTurnRestriction(TargetChooser * tc, int maxPerTurn, MTGGameZone * zone);
int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone);
};
class PlayRestrictions
{
protected:
vector<PlayRestriction *>restrictions;
public:
MaxPerTurnRestriction * getMaxPerTurnRestrictionByTargetChooser(TargetChooser * tc);
void addRestriction(PlayRestriction * restriction);
void removeRestriction(PlayRestriction * restriction);
int canPutIntoZone(MTGCardInstance * card, MTGGameZone * destZone);
~PlayRestrictions();
};
#endif