3#include<entities/spatial.h>
4#include<pugixml/pugixml.hpp>
40 inline size_t getRootSize() {
return rootEntities == NULL ? 0 : rootEntities->size(); }
59 T*
find(std::string name) {
60 if (rootEntities->size() <= 0)
63 for (
auto rootEntity : *rootEntities) {
64 auto res = rootEntity->find<T>(name);
73 std::vector<MSpatialEntity*>* rootEntities;
74 void recursivelyLoadEntity(pugi::xml_node* currNode,
MSpatialEntity* parent);
75 bool sceneClosing =
false;
77 static const std::string VALID_SCENE_FILE_XML_TAG;
An Entity is the base class for all data and behaviour oriented objects in meteor....
Definition entity.h:9
A scene holds a collection of spatial entity for a specific level.
Definition scene.h:10
bool tryParse(pugi::xml_document *doc)
Tries to parse and load a scene state.
void addToRoot(MSpatialEntity *entity)
Adds a SpatialEntity to the scene root.
T * find(std::string name)
Finds a Spatial Entity within this scene.
Definition scene.h:59
size_t getRootSize()
Returns size of root.
Definition scene.h:40
void onClose()
Invoked during scene unload.
std::vector< MSpatialEntity * > * getRootEntities()
Return a list of root entities.
Definition scene.h:44
void update(float deltaTime)
Invoked once per frame.
void startScene()
Invoked when scene loads.
bool isClosing()
Definition scene.h:53
Spatial Entity is the base entity for all types present in scene. This entity keeps track of spatial ...
Definition spatial.h:15