d5f3e4cfea
Also fixed the project includes so that we don't need to always use the indirect include path, ie: #include "../include/foo.h" -> #include "foo.h" I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too. For future reference, here's the most straightforward link on the topic of adding pch support to make files: http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project
40 lines
875 B
C++
40 lines
875 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();
|
|
}
|
|
|
|
static TrashBin<CardView> CardViewTrash;
|
|
static TrashBin<DefenserDamaged> DefenserDamagedTrash;
|
|
static TrashBin<AttackerDamaged> AttackerDamagedTrash;
|
|
|
|
void Trash::cleanup()
|
|
{
|
|
CardViewTrash.put_out();
|
|
DefenserDamagedTrash.put_out();
|
|
AttackerDamagedTrash.put_out();
|
|
}
|
|
|
|
template<> void trash(CardView* garbage)
|
|
{
|
|
CardViewTrash.bin.push_back(garbage);
|
|
}
|
|
template<> void trash(DefenserDamaged* garbage)
|
|
{
|
|
DefenserDamagedTrash.bin.push_back(garbage);
|
|
}
|
|
template<> void trash(AttackerDamaged* garbage)
|
|
{
|
|
AttackerDamagedTrash.bin.push_back(garbage);
|
|
}
|