29 lines
759 B
C++
29 lines
759 B
C++
#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_*/
|