|
3 | 3 |
|
4 | 4 | #include "Meta/MetaType.h" |
5 | 5 | #include "Meta/MetaProps.h" |
| 6 | +#include "Meta/ReflectedTypes/ReflectEnums.h" |
6 | 7 | #include "Utilities/Reflect/ReflectFieldType.h" |
7 | 8 |
|
8 | 9 | CE::MetaType CE::Input::Reflect() |
@@ -33,53 +34,20 @@ CE::MetaType CE::Input::Reflect() |
33 | 34 |
|
34 | 35 | CE::MetaType Reflector<CE::Input::KeyboardKey>::Reflect() |
35 | 36 | { |
36 | | - using namespace CE; |
37 | | - using T = Input::KeyboardKey; |
38 | | - MetaType type{ MetaType::T<T>{}, "KeyboardKey" }; |
39 | | - |
40 | | - type.GetProperties().Add(Props::sIsScriptableTag).Add(Props::sIsScriptOwnableTag); |
41 | | - type.AddFunc(std::equal_to<T>(), OperatorType::equal).GetProperties().Add(Props::sIsScriptableTag); |
42 | | - type.AddFunc(std::not_equal_to<T>(), OperatorType::inequal).GetProperties().Add(Props::sIsScriptableTag); |
43 | | - ReflectFieldType<T>(type); |
44 | | - |
45 | | - return type; |
| 37 | + return CE::ReflectEnumType<CE::Input::KeyboardKey>(true); |
46 | 38 | } |
47 | 39 |
|
48 | 40 | CE::MetaType Reflector<CE::Input::GamepadAxis>::Reflect() |
49 | 41 | { |
50 | | - using namespace CE; |
51 | | - using T = Input::GamepadAxis; |
52 | | - MetaType type{ MetaType::T<T>{}, "GamepadAxis" }; |
53 | | - |
54 | | - type.GetProperties().Add(Props::sIsScriptableTag).Add(Props::sIsScriptOwnableTag); |
55 | | - ReflectFieldType<T>(type); |
56 | | - return type; |
| 42 | + return CE::ReflectEnumType<CE::Input::GamepadAxis>(true); |
57 | 43 | } |
58 | 44 |
|
59 | 45 | CE::MetaType Reflector<CE::Input::GamepadButton>::Reflect() |
60 | 46 | { |
61 | | - using namespace CE; |
62 | | - using T = Input::GamepadButton; |
63 | | - MetaType type{ MetaType::T<T>{}, "GamepadButton" }; |
64 | | - |
65 | | - type.GetProperties().Add(Props::sIsScriptableTag).Add(Props::sIsScriptOwnableTag); |
66 | | - type.AddFunc(std::equal_to<T>(), OperatorType::equal).GetProperties().Add(Props::sIsScriptableTag); |
67 | | - type.AddFunc(std::not_equal_to<T>(), OperatorType::inequal).GetProperties().Add(Props::sIsScriptableTag); |
68 | | - ReflectFieldType<T>(type); |
69 | | - |
70 | | - return type; |
| 47 | + return CE::ReflectEnumType<CE::Input::GamepadButton>(true); |
71 | 48 | } |
72 | 49 |
|
73 | 50 | CE::MetaType Reflector<CE::Input::MouseButton>::Reflect() |
74 | 51 | { |
75 | | - using namespace CE; |
76 | | - using T = Input::MouseButton; |
77 | | - MetaType type{ MetaType::T<T>{}, "MouseButton" }; |
78 | | - |
79 | | - type.GetProperties().Add(Props::sIsScriptableTag).Add(Props::sIsScriptOwnableTag); |
80 | | - type.AddFunc(std::equal_to<T>(), OperatorType::equal).GetProperties().Add(Props::sIsScriptableTag); |
81 | | - type.AddFunc(std::not_equal_to<T>(), OperatorType::inequal).GetProperties().Add(Props::sIsScriptableTag); |
82 | | - ReflectFieldType<T>(type); |
83 | | - |
84 | | - return type; |
| 52 | + return CE::ReflectEnumType<CE::Input::MouseButton>(true); |
85 | 53 | } |
0 commit comments