Files
wagic/projects/mtg/include/PhaseRing.h
Xawotihs 9adb9d625d - reworked the testsuite and the rules (storyflow) to use the same game deserialization code, moved that code to the players and zone classes
- 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.
2011-10-01 13:30:30 +00:00

60 lines
1.1 KiB
C++

#ifndef _PHASERING_H_
#define _PHASERING_H_
#include <list>
#include <string>
using namespace std;
/*
The class that handles the phases of a turn
*/
class Player;
class GameObserver;
typedef enum
{
BLOCKERS,
TRIGGERS,
ORDER,
FIRST_STRIKE,
END_FIRST_STRIKE,
DAMAGE,
END_DAMAGE
} CombatStep;
class Phase
{
public:
int id;
Player * player;
Phase(int id, Player *player) :
id(id), player(player)
{
}
;
};
class PhaseRing
{
private:
bool extraDamagePhase(int id);
GameObserver* observer;
public:
list<Phase *> ring;
list<Phase *>::iterator current;
Phase * getCurrentPhase();
Phase * forward(bool sendEvents = true);
Phase * goToPhase(int id, Player * player, bool sendEvents = true);
PhaseRing(GameObserver* observer);
~PhaseRing();
int addPhase(Phase * phase);
int addPhaseBefore(int id, Player* player, int after_id, Player * after_player, int allOccurences = 1);
int removePhase(int id, Player * player, int allOccurences = 1);
const char * phaseName(int id);
static int phaseStrToInt(string s);
};
#endif