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
13
#include "
../Lua.hpp
"
14
15
namespace
galaxy
16
{
17
void
Lua::inject_entity
() noexcept
18
{
19
auto
& lua = entt::locator<sol::state>::value();
20
21
auto
em_type = lua.new_usertype<
EntityManager
>(
"EntityManager"
, sol::no_constructor);
22
em_type[
"registry"
] = &
EntityManager::registry
;
23
24
/*auto prefab_type = lua.new_usertype<Prefab>("Prefab", sol::constructors<Prefab(entt::entity, entt::registry&), Prefab(const nlohmann::json&)>());
25
prefab_type["from_entity"] = &Prefab::from_entity;
26
prefab_type["from_json"] = &Prefab::from_json;
27
prefab_type["to_entity"] = &Prefab::to_entity;
28
prefab_type["to_json"] = &Prefab::to_json;
29
prefab_type["load"] = &Prefab::load;
30
lua.set_function("galaxy_load_user_config", &load_config_wrapper);
31
lua.set_function("galaxy_load_window_config", &load_window_wrapper);
32
*/
33
}
34
}
// namespace galaxy
EntityManager.hpp
Lua.hpp
galaxy::EntityManager
Class for making creating and managing entities easier.
Definition
EntityManager.hpp:21
galaxy::EntityManager::registry
entt::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:17
galaxy
Tag.cpp galaxy.
Definition
Tag.cpp:13
galaxy
src
galaxy
lua
injects
LuaEntity.cpp
Generated on
for galaxy by
1.18.0