1 |
gezelter |
1101 |
#include <iostream> |
2 |
|
|
#include <stdlib.h> |
3 |
|
|
|
4 |
|
|
#include "IntegrableObjects.hpp" |
5 |
|
|
|
6 |
|
|
IntegrableObjects* IntegrableObjects::_instance = 0; |
7 |
|
|
|
8 |
|
|
IntegrableObjects* IntegrableObjects::Instance() { |
9 |
|
|
if (_instance == 0) { |
10 |
|
|
_instance = new IntegrableObjects; |
11 |
|
|
} |
12 |
|
|
return _instance; |
13 |
|
|
} |
14 |
|
|
|
15 |
|
|
IntegrableObjects::IntegrableObjects(){ |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
IntegrableObjects::~IntegrableObjects() { |
19 |
|
|
delete _instance; |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
void IntegrableObjects::addStuntDouble(StuntDouble sd) { |
23 |
|
|
|
24 |
|
|
if (!hasStuntDouble(sd)) |
25 |
|
|
integrableObjectSet.insert(sd); |
26 |
|
|
|
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
int IntegrableObjects::hasStuntDouble(StuntDouble sd) { |
30 |
|
|
|
31 |
|
|
set<StuntDouble, sd_equals>::iterator position; |
32 |
|
|
|
33 |
|
|
position = integrableObjectSet.find(sd); |
34 |
|
|
|
35 |
|
|
if (position != integrableObjectSet.end()) |
36 |
|
|
return 1; |
37 |
|
|
else |
38 |
|
|
return 0; |
39 |
|
|
|
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
int IntegrableObjects::getSize() { |
43 |
|
|
return integrableObjectSet.size(); |
44 |
|
|
} |