- Reworked the testsuite to be able to work multithreaded. This is deactivated by default everywhere except in QT_CONFIG as one testcase still refuses to pass in multithreaded mode. On my 4 cores linux desktop, the 650 tests passes now in 4 seconds (1 fails). - Replaced usage of CardSelectorSingleton by a card selector per game observer. - Modified the resource manager to be optionnal and per game observer instance instead of being a singleton. Two reasons here : threading AND Open Gl access. I only updated the crashing parts called from the game observer, so most of the code is still using the single instance. Beware of copy-paste concerning resources ... - Cleaned up the game observer constructors - Fixed several problems in action logging code while testing proliferate decks - Cleaned up Threading implementation based on QThread
58 lines
1.1 KiB
C++
58 lines
1.1 KiB
C++
#ifndef _DUELLAYERS_H_
|
|
#define _DUELLAYERS_H_
|
|
|
|
#include "GuiLayers.h"
|
|
|
|
class MTGGuiHand;
|
|
class MTGGuiPlay;
|
|
class ActionLayer;
|
|
class ActionStack;
|
|
class DamageResolverLayer;
|
|
class GuiHandSelf;
|
|
class GuiHandOpponent;
|
|
class GuiCombat;
|
|
class GuiAvatars;
|
|
class CardSelectorBase;
|
|
struct Pos;
|
|
|
|
class DuelLayers
|
|
{
|
|
protected:
|
|
int nbitems;
|
|
vector<GuiLayer*> objects;
|
|
vector<Pos*> waiters;
|
|
GuiCombat* combat;
|
|
ActionLayer* action;
|
|
ActionStack* stack;
|
|
GuiHandSelf *hand;
|
|
GuiAvatars * avatars;
|
|
GameObserver* observer;
|
|
|
|
public:
|
|
DuelLayers();
|
|
~DuelLayers();
|
|
|
|
ActionLayer * actionLayer();
|
|
ActionStack * stackLayer();
|
|
GuiCombat * combatLayer();
|
|
GuiAvatars * GetAvatars();
|
|
void init(GameObserver* go);
|
|
virtual void Update(float dt, Player * player);
|
|
void CheckUserInput(int isAI);
|
|
void Render();
|
|
void Add(GuiLayer * layer);
|
|
void Remove();
|
|
int receiveEvent(WEvent * e);
|
|
float RightBoundary();
|
|
|
|
CardSelectorBase* mCardSelector;
|
|
};
|
|
|
|
#include "ActionLayer.h"
|
|
#include "GameObserver.h"
|
|
#include "MTGGamePhase.h"
|
|
#include "ActionStack.h"
|
|
#include "Damage.h"
|
|
|
|
#endif
|