File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,14 @@ ECSACT_ALWAYS_INLINE auto serialize( //
53
53
}
54
54
55
55
/* *
56
- * Serializes an ecsact_component when the type is unknown. Size and serialize
57
- * fn are passed in to work around various linking configurations.
56
+ * Serializes an ecsact_component when the type is unknown.
58
57
* @returns serialized action bytes
59
58
*/
60
59
ECSACT_ALWAYS_INLINE auto serialize ( //
61
60
const ecsact_component& component
62
61
) -> std::vector<std::byte> {
63
62
std::vector<std::byte> out_component;
64
63
out_component.resize (ecsact_serialize_component_size (component.component_id ));
65
-
66
64
ecsact_serialize_component (
67
65
component.component_id ,
68
66
component.component_data ,
@@ -71,6 +69,23 @@ ECSACT_ALWAYS_INLINE auto serialize( //
71
69
return out_component;
72
70
}
73
71
72
+ /* *
73
+ * Serializes an ecsact_action when the type is unknown.
74
+ * @returns serialized action bytes
75
+ */
76
+ ECSACT_ALWAYS_INLINE auto serialize ( //
77
+ const ecsact_action& action
78
+ ) -> std::vector<std::byte> {
79
+ std::vector<std::byte> out_action;
80
+ out_action.resize (ecsact_serialize_action_size (action.action_id ));
81
+ ecsact_serialize_action (
82
+ action.action_id ,
83
+ action.action_data ,
84
+ reinterpret_cast <uint8_t *>(out_action.data ())
85
+ );
86
+ return out_action;
87
+ }
88
+
74
89
/* *
75
90
* Calls `ecsact_deserialize_action` or `ecsact_deserialize_component` based on
76
91
* the type of @tp T.
You can’t perform that action at this time.
0 commit comments