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
12
13#include "../Lua.hpp"
14
15namespace 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
Class for making creating and managing entities easier.
entt::registry & registry() noexcept
Get entity registry.
static void inject_entity() noexcept
Inject galaxy entity management into Lua.
Definition LuaEntity.cpp:17
Tag.cpp galaxy.
Definition Tag.cpp:13