SDEngine
Game Engine
Loading...
Searching...
No Matches
component_registration.hpp File Reference
+ Include dependency graph for component_registration.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sd::ComponentGroup< Ts >
 
struct  sd::ComponentSerializer< T >
 
struct  sd::detail::ComponentIdGenerator
 
struct  sd::ComponentTraits< T >
 
struct  sd::ComponentDebugInfo
 

Namespaces

namespace  sd
 
namespace  sd::detail
 

Concepts

concept  sd::SerializableComponent
 

Macros

#define REGISTER_SD_COMPONENT(Type)
 Registers a SD component for use with ECS.
 
#define REGISTER_COMPONENT(Type)
 Registers a component for use with ECS (non-namespaced)
 

Macro Definition Documentation

◆ REGISTER_COMPONENT

#define REGISTER_COMPONENT (   Type)
Value:
template<> \
struct ComponentTraits<Type> { \
static constexpr bool s_is_registered = true; \
static constexpr const char* name = #Type; \
static inline const usize id = detail::ComponentIdGenerator::next(); \
};
constexpr T g_type_max
Definition types.hpp:21
std::size_t usize
Definition types.hpp:18

Registers a component for use with ECS (non-namespaced)

Parameters
Typestruct type

◆ REGISTER_SD_COMPONENT

#define REGISTER_SD_COMPONENT (   Type)
Value:
template<> \
struct ComponentTraits<Type> { \
static constexpr bool s_is_registered = true; \
static constexpr const char* name = "SD_" #Type; \
static inline const usize id = detail::ComponentIdGenerator::next(); \
};

Registers a SD component for use with ECS.

Needs to be run to use a component with ECS

Parameters
Typestruct type