You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
DelayedComponentEnabler::defer() currently accepts a GameObject parameter and performs entity-level operations (has(), disableComponent()) directly inside the component. This violates the data-oriented design principle that components should be pure data containers without dependencies on entity abstractions.
Current State
// DelayedComponentEnabler.ixximport helios.engine.ecs.GameObject;
voiddefer(
helios::engine::ecs::GameObject gameObject,
helios::engine::ecs::types::ComponentTypeId componentTypeId,
constfloat delta
) {
assert(delta > 0 && "delta must be greater than 0");
constbool hasCmp = gameObject.has(componentTypeId);
assert(hasCmp && "ComponentTypeId not part of GameObject");
gameObject.disableComponent(componentTypeId);
// ... update deferredComponents_ list
}
The component imports helios.engine.ecs.GameObject solely for this method, creating an upward dependency from the data layer (component) to the entity layer (GameObject).
Proposed Change
Remove the GameObject parameter from defer(). The method should only record the deferred component entry (type ID + delay):
Move the has() assertion and disableComponent() call into the system or the calling code (e.g. DelayedComponentEnablerSystem, DelayedComponentEnablerInitializer, or the listener that invokes defer()).
Remove import helios.engine.ecs.GameObject from the component module.
Summary
DelayedComponentEnabler::defer()currently accepts aGameObjectparameter and performs entity-level operations (has(),disableComponent()) directly inside the component. This violates the data-oriented design principle that components should be pure data containers without dependencies on entity abstractions.Current State
The component imports
helios.engine.ecs.GameObjectsolely for this method, creating an upward dependency from the data layer (component) to the entity layer (GameObject).Proposed Change
Remove the
GameObjectparameter fromdefer(). The method should only record the deferred component entry (type ID + delay):Move the
has()assertion anddisableComponent()call into the system or the calling code (e.g.DelayedComponentEnablerSystem,DelayedComponentEnablerInitializer, or the listener that invokesdefer()).Remove
import helios.engine.ecs.GameObjectfrom the component module.Affected Files
include/helios/engine/mechanics/lifecycle/components/DelayedComponentEnabler.ixxinclude/helios/engine/mechanics/lifecycle/systems/DelayedComponentEnablerSystem.ixxinclude/helios/engine/runtime/spawn/behavior/initializers/DelayedComponentEnablerInitializer.ixxdefer()with aGameObject(e.g.MatchStateListener.ixx)Motivation
has,disableComponent) belongs in systems or orchestrating code.Labels
refactor,ecs