.. _program_listing_file_PrismEngine_src_scene.h: Program Listing for File scene.h ================================ |exhale_lsh| :ref:`Return to documentation for file ` (``PrismEngine/src/scene.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #pragma once #include #include #include #include #include #include #include #include "entityManager.h" #include "componentManager.h" #include "systemManager.h" namespace prism { namespace scene { class Scene { public: Scene() = default; Entity createEntity(); bool destroyEntity(Entity entityId); void enableSystem(SystemId systemId); void disableSystem(SystemId systemId); void update(float deltaTime) { systemManager.update(deltaTime); } // шаблонные методы определены здесь в .h (по-другому не компилится) template bool addComponent(Entity entityId, T component) { return componentManager.addComponent(entityId, component); }; template bool removeComponent(Entity entityId) { return componentManager.removeComponent(entityId); }; template T* getComponent(Entity entityId) { return componentManager.getComponent(entityId); }; template std::set& getEntitiesWith() { return componentManager.getEntitiesWith(); }; template std::set getEntitiesWithAll() { return componentManager.getEntitiesWithAll(); }; template SystemId registerSystem(Args&&... args) { return systemManager.registerSystem(std::forward(args)...); }; private: EntityManager entityManager; ComponentManager componentManager; SystemManager systemManager; }; } }