Unravel Engine C++ Reference
Loading...
Searching...
No Matches
test_component.cpp
Go to the documentation of this file.
1#include "test_component.hpp"
2#include "entt/meta/policy.hpp"
7
8namespace unravel
9{
11{
12 entt::meta_factory<named_anim>{}
13 .type("named_anim"_hs)
15 entt::attribute{"name", "named_anim"},
16 entt::attribute{"category", "BASIC"},
17 entt::attribute{"pretty_name", "Named Anim"},
18 })
19 .data<&named_anim::name>("name"_hs)
21 entt::attribute{"name", "name"},
22 })
23 .data<&named_anim::clip>("clip"_hs)
25 entt::attribute{"name", "clip"},
26 });
27
28 // Register test_component class with entt (complete implementation)
29 entt::meta_factory<test_component>{}
30 .type("test_component"_hs)
32 entt::attribute{"name", "test_component"},
33 entt::attribute{"category", "BASIC"},
34 entt::attribute{"pretty_name", "Test"},
35 })
36 .func<&component_meta<test_component>::exists>("component_exists"_hs)
37 .func<&component_meta<test_component>::add>("component_add"_hs)
38 .func<&component_meta<test_component>::remove>("component_remove"_hs)
39 .func<&component_meta<test_component>::save>("component_save"_hs)
40 .func<&component_meta<test_component>::load>("component_load"_hs)
41 .data<&test_component::str>("str"_hs)
42 .custom<entt::attributes>(entt::attributes{
43 entt::attribute{"name", "str"},
44 })
45 .data<&test_component::u8>("u8"_hs)
47 entt::attribute{"name", "u8"},
48 })
49 .data<&test_component::u16>("u16"_hs)
51 entt::attribute{"name", "u16"},
52 })
53 .data<&test_component::u32>("u32"_hs)
55 entt::attribute{"name", "u32"},
56 })
57 .data<&test_component::u64>("u64"_hs)
59 entt::attribute{"name", "u64"},
60 })
61 .data<&test_component::i8>("i8"_hs)
63 entt::attribute{"name", "i8"},
64 })
65 .data<&test_component::i16>("i16"_hs)
67 entt::attribute{"name", "i16"},
68 })
69 .data<&test_component::i32>("i32"_hs)
71 entt::attribute{"name", "i32"},
72 })
73 .data<&test_component::i64>("i64"_hs)
75 entt::attribute{"name", "i64"},
76 })
77 .data<&test_component::f>("f"_hs)
79 entt::attribute{"name", "f"},
80 })
81 .data<&test_component::d>("d"_hs)
83 entt::attribute{"name", "d"},
84 })
85 .data<&test_component::irange>("irange"_hs)
87 entt::attribute{"name", "irange"},
88 })
89 .data<&test_component::isize>("isize"_hs)
91 entt::attribute{"name", "isize"},
92 })
93 .data<&test_component::ipoint>("ipoint"_hs)
95 entt::attribute{"name", "ipoint"},
96 })
97 .data<&test_component::irect>("irect"_hs)
99 entt::attribute{"name", "irect"},
100 })
101 .data<&test_component::delta>("delta"_hs)
103 entt::attribute{"name", "delta"},
104 })
105 .data<&test_component::color>("color"_hs)
107 entt::attribute{"name", "color"},
108 })
109 .data<&test_component::texture>("texture"_hs)
111 entt::attribute{"name", "texture"},
112 })
113 .data<&test_component::mat>("mat"_hs)
115 entt::attribute{"name", "mat"},
116 })
117 .data<&test_component::anim>("anim"_hs)
119 entt::attribute{"name", "anim"},
120 })
121 .data<&test_component::sequential>("sequential"_hs)
123 entt::attribute{"name", "sequential"},
124 })
125 .data<&test_component::associative>("associative"_hs)
127 entt::attribute{"name", "associative"},
128 })
129 .data<&test_component::associative_mock>("associative_mock"_hs)
131 entt::attribute{"name", "associative_mock"},
132 });
133}
134
140
146
147} // 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)
#define LOAD_INSTANTIATE(cls, Archive)
#define SAVE(cls)