J :
* Add the Trash facility and use it for CardViews. * Fix a graphical bug with card shadows. * Fix a graphical bug with limitors. * Enhance the graphical appearance of cards going to graveyard.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include <iostream>
|
||||
#include "../include/MTGDefinitions.h"
|
||||
#include "../include/Pos.h"
|
||||
#include "../include/CardGui.h"
|
||||
#include "../include/Trash.h"
|
||||
|
||||
void Trash::put_out()
|
||||
{
|
||||
for (std::vector<Pos*>::iterator it = bin.begin(); it != bin.end(); ++it)
|
||||
{
|
||||
std::cout << "DELETE " << *it << std::endl;
|
||||
if (CardView *c = dynamic_cast<CardView*>(*it))
|
||||
SAFE_DELETE(c);
|
||||
else
|
||||
SAFE_DELETE(*it);
|
||||
}
|
||||
bin.clear();
|
||||
}
|
||||
|
||||
static Trash PosTrash;
|
||||
|
||||
void Trash::cleanup()
|
||||
{
|
||||
PosTrash.put_out();
|
||||
}
|
||||
|
||||
void trash(Pos* garbage)
|
||||
{
|
||||
PosTrash.bin.push_back(garbage);
|
||||
}
|
||||
Reference in New Issue
Block a user