Nebula
Loading...
Searching...
No Matches
Game::ComponentRegisterInfo< COMPONENT_TYPE > Struct Template Reference

#include <component.h>

Detailed Description

template<typename COMPONENT_TYPE>
struct Game::ComponentRegisterInfo< COMPONENT_TYPE >

Used for registering component types to the game world.

See also
Game::World

Public Types

using OnInitFunc = void (*)(Game::World*, Game::Entity, COMPONENT_TYPE*)
using OnDecayFunc = void (*)(Game::World*, Game::Entity, COMPONENT_TYPE*)

Public Attributes

bool decay = false
 Set to true if the component should end up in the decay buffer before being completely destroyed.
OnInitFunc OnInit = nullptr
 initialization function to run for the component, or nullptr if not needed.
OnDecayFunc OnDecay = nullptr
 function to run when the component is removed from a live entity, or when the entity is deleted.

Member Typedef Documentation

◆ OnDecayFunc

template<typename COMPONENT_TYPE>
using Game::ComponentRegisterInfo< COMPONENT_TYPE >::OnDecayFunc = void (*)(Game::World*, Game::Entity, COMPONENT_TYPE*)

◆ OnInitFunc

template<typename COMPONENT_TYPE>
using Game::ComponentRegisterInfo< COMPONENT_TYPE >::OnInitFunc = void (*)(Game::World*, Game::Entity, COMPONENT_TYPE*)

Member Data Documentation

◆ decay

template<typename COMPONENT_TYPE>
bool Game::ComponentRegisterInfo< COMPONENT_TYPE >::decay = false

Set to true if the component should end up in the decay buffer before being completely destroyed.

◆ OnDecay

template<typename COMPONENT_TYPE>
OnDecayFunc Game::ComponentRegisterInfo< COMPONENT_TYPE >::OnDecay = nullptr

function to run when the component is removed from a live entity, or when the entity is deleted.

Runs outside the frame pipeline while the component is still readable from its table, which allows cleaning up or marking up anything related to the component. Independent of the decay buffer. nullptr if not needed.

◆ OnInit

template<typename COMPONENT_TYPE>
OnInitFunc Game::ComponentRegisterInfo< COMPONENT_TYPE >::OnInit = nullptr

initialization function to run for the component, or nullptr if not needed.


The documentation for this struct was generated from the following file: