Files
wagic/projects/mtg/include/PhaseRing.h
Xawotihs 3514476812 - Created a GamePhase type to ease debug.
- Modified the testsuite and gameobserver to be able to replay all the testcases based on the actions logged during the first pass. This allows to test the action logging and replay used during undo. It's only activated in multithreaded mode and it does not work on Momir tests.
-  Modified choice logging and replay to use menuId instead of ability index, as, for some obscur reasons related to Lord, those ability indexes may change.
- Fixed bug in nextphase logging wrongly generating click actions
- Added a "stack" zone to the click ability logging to be able to replay properly interrupt
- Fixed a wonderful bug mixing card names with zone names in the actions execution engine
- Added a "combatok" action logging/execution
- Added a "clone" virtual method to MTGCardInstance and Token to be able to clone correctly the right object type. Used that in MTGGameZones::removeCard
2011-11-29 21:50:16 +00:00

61 lines
1.2 KiB
C++

#ifndef _PHASERING_H_
#define _PHASERING_H_
#include <list>
#include <string>
#include "MTGDefinitions.h"
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:
GamePhase id;
Player * player;
Phase(GamePhase 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(GamePhase 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 GamePhase phaseStrToInt(string s);
};
#endif