Class Component

Nested Relationships

Nested Types

Inheritance Relationships

Derived Types

Class Documentation

class Component

An ECS style interface of a collection of data that helps implement a behaviour. Also allows operations on that data.

Subclassed by AudioComponent, AudioListenerComponent, CameraComponent, CollisionComponent, DirectionalLightComponent, FogComponent, ParticleEffectComponent, PlayerController, PointLightComponent, RenderableComponent, RenderUIComponent, SkyComponent, SpotLightComponent, TransformAnimationComponent, TransformComponent, UIComponent

Public Functions

Component(Entity &owner)
virtual ~Component()
void registerDependency(Dependable *dependable)

Only use to register dependency through a Dependency object.

const Vector<Dependable *> &getDependencies() const
bool resolveDependencies()

Establish inter-component links after all components have been added on the owner entity. Return true if successful.

virtual bool setupData()

Perform setting up internal data needed from other components after they have been added to the owning entity.

virtual bool setupEntities()

Perform setting up operations which are possible only after all entities have been set up.

virtual void onRemove()

Perform operations prior to detachment from owning entity and destruction.

Entity &getOwner()
virtual ComponentID getComponentID() const = 0
virtual const char *getName() const = 0
virtual JSON::json getJSON() const

Get JSON representation of the component data needed to re-construct component from memory.

virtual void draw()

Expose the component data with ImGui.

Protected Attributes

Entity *m_Owner
struct Category

Public Static Attributes

const String General = "General"
const String Audio = "Audio"
const String Game = "Game"
const String Physics = "Physics"
const String Model = "Model"
const String Effect = "Effect"
const String Light = "Light"
const String UI = "UI"