Tramway SDK v0.1.1
|
#include <framework/entitycomponent.h>
Public Member Functions | |
EntityComponent ()=default | |
virtual | ~EntityComponent ()=default |
virtual void | Init () |
Initializes an entity component. More... | |
virtual void | EventHandler (Event &event)=0 |
bool | IsReady () |
Returns the component's readiness. More... | |
bool | IsInit () |
Returns the component's init status. More... | |
Entity * | GetParent () |
void | SetParent (Entity *parent) |
Protected Member Functions | |
void | ResourceReady () |
Notifies the component of a streamed-in resource. More... | |
virtual void | Start ()=0 |
Protected Attributes | |
size_t | resources_waiting = 0 |
bool | is_ready = false |
bool | is_init = false |
Entity * | parent = nullptr |
Friends | |
template<typename T > | |
class | ResourceProxy |
void | Async::FinishResources () |
Component base class.
Usually the way that components work is that a user creates a component, i.e. constructs an instance of a component, then they call setter methods on it to feed it parameters and finally they call the Init() method in the component.
In turn, the base component class checks whether all of the component's requested resources have been loaded and then calls the component's Start() method.
|
default |
|
virtualdefault |
|
pure virtual |
Implemented in tram::AnimationComponent, tram::AudioComponent, tram::DecalComponent, tram::LightComponent, tram::ParticleComponent, tram::PhysicsComponent, tram::PlayerComponent, tram::RenderComponent, tram::SpriteComponent, tram::TemplateComponent, tram::TriggerComponent, tram::Ext::Kitchensink::AnimationStateComponent, tram::FPSControllerComponent, and tram::RaycastControllerComponent.
|
inline |
|
virtual |
Initializes an entity component.
If an entity component has all of its resources already loaded, this will immediately Start() the component.
Reimplemented in tram::LightComponent, tram::PlayerComponent, and tram::TemplateComponent.
|
inline |
Returns the component's init status.
|
inline |
|
protected |
Notifies the component of a streamed-in resource.
|
inline |
|
protectedpure virtual |
Implemented in tram::AnimationComponent, tram::AudioComponent, tram::DecalComponent, tram::LightComponent, tram::ParticleComponent, tram::PhysicsComponent, tram::PlayerComponent, tram::RenderComponent, tram::SpriteComponent, tram::TemplateComponent, tram::TriggerComponent, tram::Ext::Kitchensink::AnimationStateComponent, tram::FPSControllerComponent, and tram::RaycastControllerComponent.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |