30 |
Object* clone() { return this; } \ |
Object* clone() { return this; } \ |
31 |
void dispose() {} |
void dispose() {} |
32 |
|
|
33 |
|
|
34 |
|
#define INSTANCELISTOBJ(type) \ |
35 |
|
typedef std::vector<type*> InstanceList; \ |
36 |
|
static InstanceList instances; \ |
37 |
|
Object *clone() { type *o = new type; instances.push_back(o); return o;} \ |
38 |
|
void dispose() { \ |
39 |
|
instances.erase(find(instances.begin(), instances.end(), this)); \ |
40 |
|
delete this; \ |
41 |
|
} |
42 |
|
|
43 |
//---------------------------------------- |
//---------------------------------------- |
44 |
// MovableStone |
// MovableStone |
45 |
// |
// |