52 virtual void tick(
double deltaTime);
virtual void beginPlay()
Called when the component is added to the scene or the game starts.
static constexpr bool IsUnique
Defines whether multiple instances of this component can exist on the same entity....
bool canTick() const
Checks if the component is currently set to tick.
Entities::Scene * getScene() const
Gets the scene this component belongs to.
Logic(Entities::Scene *owningScene)
virtual std::string getComponentName() const
Gets the component type name for debugging/UI.
static constexpr const char * ComponentName
Fallback component type name. Derived classes may override getComponentName() for custom labels.
bool hasBegunPlay() const
void setCanTick(bool enable)
Enables or disables ticking for this component.
Entities::Entity * getOwningEntity() const
Gets the entity this component belongs to.
Entities::Entity * owningEntity_
void setOwningEntity(Entities::Entity *entity)
Sets the owning entity. Called by Entity::addComponent().
virtual void endPlay()
Called when the component is removed or the game ends.
virtual void tick(double deltaTime)
Called every frame if ticking is enabled.
Core::SceneManager * getSceneManager() const
Helper to get the SceneManager from the owning scene.
Manages game objects within a scene, handling registration, ID allocation, and GPU buffer synchroniza...
The entity class is the base class of everything which is attached to a scene. If it is part of a sce...
A scene is the overarching structure which can spawn, contain and destroy actors or entities.
Core audio subsystem owning the miniaudio engine and managing playback.