Files
wagic/projects/mtg/include/PlayRestrictions.h
wagic.the.homebrew@gmail.com 8dd6856453 Erwan
- fixed issue 595 (MaxCast not working). Root cause was the stupidest typo ever in the code (maxCost instead of maxCast...)
- fixed an issue with Storm mentioned by zethfox (was counting only spells played by current player)
- Moved "max lands per turn" rule outside of the code (yay!) Please be sure to update your Rules folder!
2011-02-15 14:17:34 +00:00

56 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);
~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