Skip to content

Triggers: attaching actions to a state which is the current #112

@tomtzook

Description

@tomtzook

When attaching actions to triggers for a state which is current, the actions won't be used as expected until the next cycling of the action state.

For example, say the current state is TriggerState.ACTIVE, and someone invokes Trigger.whenActive with some action, this action won't be started.

The root for this is that the updates to attached actions are only done in GenericTrigger.update (called by the scheduler), which only updates the actions if the state has changed.

Problem is, we can't simply act on the actions via the attach methods (like Trigger.whenActive) because it is only allowed (and possible) via GenericTrigger.update. So either we change this, or create some list which registers newly attached actions, and in update perform special handling for them.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions