- 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
43 lines
799 B
C++
43 lines
799 B
C++
#ifndef _TRASH_H_
|
|
#define _TRASH_H_
|
|
|
|
#include <vector>
|
|
#include "Pos.h"
|
|
#include "WEvent.h"
|
|
#include "DamagerDamaged.h"
|
|
|
|
class CardView;
|
|
class AttackerDamaged;
|
|
class DamagerDamaged;
|
|
typedef DamagerDamaged DefenserDamaged;
|
|
|
|
template<class T> void trash(T*);
|
|
|
|
template<class T>
|
|
class TrashBin
|
|
{
|
|
std::vector<T> bin;
|
|
void put_out();
|
|
int receiveEvent(WEvent* e);
|
|
template<class Q> friend void trash(Q*);
|
|
friend class Trash;
|
|
};
|
|
|
|
|
|
class Trash
|
|
{
|
|
private:
|
|
TrashBin<CardView*> CardViewTrash;
|
|
TrashBin<DefenserDamaged*> DefenserDamagedTrash;
|
|
TrashBin<AttackerDamaged*> AttackerDamagedTrash;
|
|
|
|
public:
|
|
Trash(){};
|
|
void cleanup();
|
|
void trash(CardView* garbage);
|
|
void trash(DefenserDamaged* garbage);
|
|
void trash(AttackerDamaged* garbage);
|
|
};
|
|
|
|
#endif // _TRASH_H_
|