OGL Engine 1.2.0-dev
Loading...
Searching...
No Matches
Engine::ECS::Component Class Reference

Classe Component à dériver pour pouvoir être utilisée dans les systèmes ECS. More...

#include <component.hpp>

Inheritance diagram for Engine::ECS::Component:
Engine::ECS::Children Engine::ECS::Parent Engine::Graphics::Particle Engine::Graphics::ParticleEmitter Engine::Graphics::Sprite Engine::Graphics::SpriteAnimator Engine::Physics::BoxCollider Engine::Physics::Rigidbody Engine::Scene::Behaviour Engine::Scene::Transform Engine::UI::Action Engine::UI::Element Engine::UI::Text

Public Member Functions

 Component ()=default
void SetEntity (Entity e)
 Attache l'entité au component.
EntityGetEntity () const
 Renvoie l'entité attachée.
RegistryGetRegistry () const
 Renvoie le registre actuel.
Scene::SceneGetScene () const
 Renvoie la scène en cours.
AppGetApp () const
 Renvoie l'instance d'application.

Public Attributes

bool enabled = true

Friends

class Registry

Detailed Description

Classe Component à dériver pour pouvoir être utilisée dans les systèmes ECS.

Son intérêt réside dans le fait qu'elle peut stocker une entité et la renvoyer. Dans le cadre de l'ECS, c'est le registre qui créé les components, et au passage, il appelle le setter pour lui attacher l'entité

Constructor & Destructor Documentation

◆ Component()

Engine::ECS::Component::Component ( )
default

Member Function Documentation

◆ GetApp()

App & Engine::ECS::Component::GetApp ( ) const
inline

Renvoie l'instance d'application.

Returns
App&

◆ GetEntity()

Entity & Engine::ECS::Component::GetEntity ( ) const
inline

Renvoie l'entité attachée.

Utile dans les systèmes qui traitent avec des composants externes (physique par exemple). On peut faire dans un callback (Component& other) => other.GetEntity() ...

Returns
Entity

◆ GetRegistry()

Registry & Engine::ECS::Component::GetRegistry ( ) const
inline

Renvoie le registre actuel.

Returns
Registry&

◆ GetScene()

Scene::Scene & Engine::ECS::Component::GetScene ( ) const
inline

Renvoie la scène en cours.

Returns
Scene::Scene&

◆ SetEntity()

void Engine::ECS::Component::SetEntity ( Entity e)
inline

Attache l'entité au component.

Parameters
e

◆ Registry

friend class Registry
friend

Member Data Documentation

◆ enabled

bool Engine::ECS::Component::enabled = true

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