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
LuaFlags.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9#include <sol/sol.hpp>
10#include <entt_sol/registry/bond.hpp>
11
14
15#include "../Lua.hpp"
16
17namespace galaxy
18{
19 void Lua::inject_flags() noexcept
20 {
21 auto& lua = entt::locator<sol::state>::value();
22
23 lua.new_usertype<flags::DontSerialize>("DontSerialize", sol::constructors<flags::DontSerialize()>(), "type_id", &entt::type_hash<flags::DontSerialize>::value);
24 lua.new_usertype<flags::Disabled>("Disabled", sol::constructors<flags::Disabled()>(), "type_id", &entt::type_hash<flags::Disabled>::value);
25
26 entt_sol::register_meta_component<flags::DontSerialize>();
27 entt_sol::register_meta_component<flags::Disabled>();
28 }
29} // namespace galaxy
static void inject_flags() noexcept
Injects galaxy flag components into Lua.
Definition LuaFlags.cpp:19
Used to stop an entity from being updated/rendered.
Definition Disabled.hpp:21
Used to stop an entity from being serialized to json data.
Tag.cpp galaxy.
Definition Tag.cpp:13