Unravel Engine C++ Reference
Loading...
Searching...
No Matches
layer_component.cpp
Go to the documentation of this file.
1#include "layer_component.hpp"
2
5
8namespace unravel
9{
11{
12 entt::meta_factory<layer_component>{}
13 .type("layer_component"_hs)
15 entt::attribute{"name", "layer_component"},
16 entt::attribute{"category", "BASIC"},
17 entt::attribute{"pretty_name", "Layer"},
18 })
19 .func<&component_meta<layer_component>::exists>("component_exists"_hs)
20 .func<&component_meta<layer_component>::add>("component_add"_hs)
21 .func<&component_meta<layer_component>::remove>("component_remove"_hs)
22 .func<&component_meta<layer_component>::save>("component_save"_hs)
23 .func<&component_meta<layer_component>::load>("component_load"_hs)
24 .data<&layer_component::layers>("layers"_hs)
25 .custom<entt::attributes>(entt::attributes{
26 entt::attribute{"name", "layers"},
27 entt::attribute{"pretty_name", "Layers"},
28 entt::attribute{"tooltip", "This is the layers of the entity."},
29 });
30}
31
33{
34 try_save(ar, ser20::make_nvp("layers", obj.layers));
35}
38
40{
41 try_load(ar, ser20::make_nvp("layers", obj.layers));
42}
43
46} // namespace unravel
attributes::value_type attribute
Definition reflection.h:19
std::map< std::string, meta_any > attributes
Definition reflection.h:18
BinaryInputArchive iarchive_binary_t
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
#define REFLECT(cls)
Definition reflection.h:133
#define SAVE_INSTANTIATE(cls, Archive)
#define LOAD(cls)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
#define SAVE(cls)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
Component that provides a layer mask for an entity.