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
LuaEntity.cpp
Go to the documentation of this file.
1
7
8
#include <entt/locator/locator.hpp>
9
#include <sol/sol.hpp>
10
11
#include "
galaxy/entity/EntityManager.hpp
"
12
#include "
galaxy/entity/Registry.hpp
"
13
14
#include "
../Lua.hpp
"
15
16
namespace
galaxy
17
{
18
void
Lua::inject_entity
() noexcept
19
{
20
auto
& lua = entt::locator<sol::state>::value();
21
22
auto
registry_type = lua.new_usertype<
Registry
>(
"Registry"
, sol::constructors<Registry()>());
23
registry_type[
"entt"
] = &
Registry::m_entt
;
24
25
auto
em_type = lua.new_usertype<
EntityManager
>(
"EntityManager"
, sol::no_constructor);
26
em_type[
"registry"
] = &
EntityManager::registry
;
27
28
/*auto prefab_type = lua.new_usertype<Prefab>("Prefab", sol::constructors<Prefab(entt::entity, entt::registry&), Prefab(const nlohmann::json&)>());
29
prefab_type["from_entity"] = &Prefab::from_entity;
30
prefab_type["from_json"] = &Prefab::from_json;
31
prefab_type["to_entity"] = &Prefab::to_entity;
32
prefab_type["to_json"] = &Prefab::to_json;
33
prefab_type["load"] = &Prefab::load;
34
lua.set_function("galaxy_load_user_config", &load_config_wrapper);
35
lua.set_function("galaxy_load_window_config", &load_window_wrapper);
36
*/
37
}
38
}
// namespace galaxy
EntityManager.hpp
Lua.hpp
Registry.hpp
galaxy::EntityManager
Class for making creating and managing entities easier.
Definition
EntityManager.hpp:21
galaxy::EntityManager::registry
Registry & registry() noexcept
Get entity registry.
Definition
EntityManager.cpp:35
galaxy::Lua::inject_entity
static void inject_entity() noexcept
Inject galaxy entity management into Lua.
Definition
LuaEntity.cpp:18
galaxy::Registry
Wrapper around entt::registry to expand functionality.
Definition
Registry.hpp:19
galaxy::Registry::m_entt
entt::registry m_entt
Function that integrates a box2d construction with entt.
Definition
Registry.hpp:167
galaxy
Application.hpp galaxy.
Definition
Application.cpp:40
galaxy
src
galaxy
lua
injects
LuaEntity.cpp
Generated on Sun Feb 1 2026 05:57:14 for galaxy by
1.12.0