NcEngine
|
Optional data and callbacks for generic component operations. More...
#include <Component.h>
Public Types | |
using | Factory_t = std::move_only_function< T(Entity entity, const std::any &userData)> |
Function type for the Factory handler. | |
using | Serialize_t = std::move_only_function< void(std::ostream &binaryStream, const T &component, const SerializationContext &ctx, const std::any &userData)> |
Function type for the serialize handler. | |
using | Deserialize_t = std::move_only_function< T(std::istream &binaryStream, const DeserializationContext &ctx, const std::any &userData)> |
Function type for the deserialize handler. | |
using | DrawUI_t = std::move_only_function< void(T &component, ui::editor::EditorContext &ctx, const std::any &userData)> |
Function type for the DrawUI handler. | |
Public Attributes | |
size_t | id = 0ull |
A unique identifier for the component. More... | |
std::string | name = "User Component" |
A name for the component with no uniqueness constraints. | |
std::any | userData = std::any{} |
Optional user data, which is passed to the factory, serialize, and deserialize handlers. | |
Factory_t | factory = nullptr |
Callback for creating an instance of T. More... | |
Serialize_t | serialize = nullptr |
Callback for serializing an instance of T. More... | |
Deserialize_t | deserialize = nullptr |
Callback for deserializing an instance of T. More... | |
DrawUI_t | drawUI = nullptr |
Callback for drawing T's UI widget. | |
Optional data and callbacks for generic component operations.
Deserialize_t nc::ComponentHandler< T >::deserialize = nullptr |
Callback for deserializing an instance of T.
Factory_t nc::ComponentHandler< T >::factory = nullptr |
Callback for creating an instance of T.
size_t nc::ComponentHandler< T >::id = 0ull |
A unique identifier for the component.
Serialize_t nc::ComponentHandler< T >::serialize = nullptr |
Callback for serializing an instance of T.