- 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
36 lines
729 B
C++
36 lines
729 B
C++
#include "PrecompiledHeader.h"
|
|
|
|
#include "MTGDefinitions.h"
|
|
#include "Pos.h"
|
|
#include "CardGui.h"
|
|
#include "DamagerDamaged.h"
|
|
#include "Trash.h"
|
|
|
|
template<class T>
|
|
void TrashBin<T>::put_out()
|
|
{
|
|
for (typename std::vector<T>::iterator it = bin.begin(); it != bin.end(); ++it)
|
|
SAFE_DELETE(*it);
|
|
bin.clear();
|
|
}
|
|
|
|
void Trash::cleanup()
|
|
{
|
|
CardViewTrash.put_out();
|
|
DefenserDamagedTrash.put_out();
|
|
AttackerDamagedTrash.put_out();
|
|
}
|
|
|
|
void Trash::trash(CardView* garbage)
|
|
{
|
|
CardViewTrash.bin.push_back(garbage);
|
|
}
|
|
void Trash::trash(DefenserDamaged* garbage)
|
|
{
|
|
DefenserDamagedTrash.bin.push_back(garbage);
|
|
}
|
|
void Trash::trash(AttackerDamaged* garbage)
|
|
{
|
|
AttackerDamagedTrash.bin.push_back(garbage);
|
|
}
|