galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
LuaSystems.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9#include <sol/sol.hpp>
10
12
13#include "../Lua.hpp"
14
15namespace galaxy
16{
17 void Lua::inject_systems() noexcept
18 {
19 auto& lua = entt::locator<sol::state>::value();
20
21 auto sm_type = lua.new_usertype<SystemManager>("SystemManager", sol::no_constructor);
22 sm_type["add_system"] = &SystemManager::add_system;
23 sm_type["clear"] = &SystemManager::clear;
24 sm_type["resume"] = &SystemManager::resume;
25 sm_type["stack"] = &SystemManager::stack;
26 sm_type["suspend"] = &SystemManager::suspend;
27 sm_type["update"] = &SystemManager::update;
28 }
29} // namespace galaxy
static void inject_systems() noexcept
Injects galaxy system management into Lua.
Manages the systems assigned to it.
void add_system(const std::string &system)
Add a system to operate on entities in this scene.
void clear()
Remove all systems.
void resume() noexcept
Resume all systems.
void suspend() noexcept
Suspend all running systems.
void update(EntityManager &em, Scene *scene)
Process all systems.
SystemStack & stack() noexcept
Get list of systems.
Application.hpp galaxy.