blob: 792a8fcf08b5825884ad14f2813a0717b038b7ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef LEVEL_H_
#define LEVEL_H_
#include "LevelObject.h"
#include "SharedPtr.h"
#include "PlayerStart.h"
#include "Portal.h"
#include "LevelVertex.h"
#include <vector>
class Level : public std::vector<SharedPtr<LevelObject> > {
public:
Level() {
addWithChildren(SharedPtr<LevelObject>(new PlayerStart()));
addWithChildren(SharedPtr<LevelObject>(new Portal(2, 2, 0.4f)));
}
void addWithChildren(SharedPtr<LevelObject> object) {
push_back(object);
std::vector<SharedPtr<LevelObject> > children = object->getChildren();
for(std::vector<SharedPtr<LevelObject> >::iterator child = children.begin(); child != children.end(); child++)
addWithChildren(*child);
}
};
#endif /*LEVEL_H_*/
|