Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: CBA_statemachine_fnc_addCompoundState #1082

Closed
Fusselwurm opened this issue Feb 28, 2019 · 1 comment
Closed

Feature request: CBA_statemachine_fnc_addCompoundState #1082

Fusselwurm opened this issue Feb 28, 2019 · 1 comment
Labels
Milestone

Comments

@Fusselwurm
Copy link
Contributor

The ability for states to include substates by nesting a state machine – thus creating compound states – would be a nice addition the CBA state machine library.

( see also https://statecharts.github.io/glossary/compound-state.html )

tl;dr:

  • entering the compound state adds the item to the initial state in the nested state machine
  • exiting the compound state
    • executes the nested state's onExit handler
    • removes the item from the nested state machine

Proposed interface:

Description

Adds a compound state to a state machine.

Parameters

name description type
_stateMachine state machine <LOCATION>
_nestedStateMachine state machine to be nested in the state <LOCATION>
_onState code that is executed when state is active (frequency depends on amount of objects active in state machine) <CODE> (Default: {})
_onStateEntered code that is executed once when state was entered, after onTransition (also once for the intial state) <CODE> (Default: {})
_onStateLeaving code that is executed once when exiting state, before onTransition <CODE> (Default: {})
_name unique state name STRING (Default: “stateX” with X being a unique number)

Returns

description type
_name unique state name or empty string on error <STRING>

Examples

_name = [_stateMachine, _nestedMachine, {}] call CBA_statemachine_fnc_addCompoundState;

@commy2 commy2 modified the milestones: Ongoing, Backlog Mar 20, 2019
@commy2 commy2 mentioned this issue Jan 19, 2020
6 tasks
@commy2 commy2 modified the milestones: Backlog, Ongoing Jan 19, 2020
@commy2 commy2 closed this as completed Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants