- Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).

- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
This commit is contained in:
Xawotihs
2011-11-13 22:36:34 +00:00
parent 2240c14f56
commit f68c106e7e
33 changed files with 320 additions and 141 deletions
+12 -9
View File
@@ -190,9 +190,18 @@ public:
class ActionStack :public GuiLayer
{
public:
typedef enum
{
NOT_DECIDED = 0,
INTERRUPT = -1,
DONT_INTERRUPT = 1,
DONT_INTERRUPT_ALL = 2
} InterruptDecision;
protected:
JQuadPtr pspIcons[8];
int interruptDecision[2];
InterruptDecision interruptDecision[2];
float timer;
int currentState;
int mode;
@@ -201,13 +210,6 @@ protected:
public:
enum
{
NOT_DECIDED = 0,
INTERRUPT = -1,
DONT_INTERRUPT = 1,
DONT_INTERRUPT_ALL = 2,
};
Player * lastActionController;
int setIsInterrupting(Player * player, bool log = true);
int count( int type = 0 , int state = 0 , int display = -1);
@@ -218,7 +220,7 @@ public:
int getNextIndex(Interruptible * previous, int type = 0, int state = 0 , int display = -1);
void Fizzle(Interruptible * action);
Interruptible * getAt(int id);
void cancelInterruptOffer(int cancelMode = 1, bool log = true);
void cancelInterruptOffer(InterruptDecision cancelMode = DONT_INTERRUPT, bool log = true);
void endOfInterruption(bool log = true);
Interruptible * getLatest(int state);
Player * askIfWishesToInterrupt;
@@ -245,6 +247,7 @@ public:
#endif
void setCurrentTutorial(ATutorialMessage* message) {currentTutorial = message;};
ATutorialMessage* getCurrentTutorial() {return currentTutorial;};
bool isCalm() {return interruptDecision[0] == NOT_DECIDED && interruptDecision[1] == NOT_DECIDED;};
};
#endif