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 Sep 4, 2025. It is now read-only.
Allow components to be enabled and disabled. Entity::Get<>() should return a nullptr and ForAll<>() should skip an entity if a required component is disabled. Messages shouldn't be handled by disabled components. A component should provide handler methods (HandleEnable and HandleDisable) so that it can react to a state change.
Here's a usage example from Unvanquished:
When I come to the point where there'll be components such as JetpackComponent, it doesn't make sense to have specialized entities for each combination of components anymore (JetpackLightarmorPulserifleGrenadeHumanClientEntity!), so I need a way to enable and disable components on existing entities during runtime. I think this functionality should be provided by the backend, otherwise you'd have a "if (!enabled) return …;" in virtually every component method and the components would falsly show up when iterating over entitites that have certain components.
One problem that could occur is that if you have a reference to a component and then that component gets disabled, you could still call its methods. I think we can/have to live with that though.
Allow components to be enabled and disabled.
Entity::Get<>()should return anullptrandForAll<>()should skip an entity if a required component is disabled. Messages shouldn't be handled by disabled components. A component should provide handler methods (HandleEnableandHandleDisable) so that it can react to a state change.Here's a usage example from Unvanquished:
One problem that could occur is that if you have a reference to a component and then that component gets disabled, you could still call its methods. I think we can/have to live with that though.