We currently require that all states be declared during the archetype parsing phase. This feature would allow importing additional states to the entity-descriptor if they're referenced as possible transition states in one of the regularly imported state definitions.
Example:
Archetype declare States A & B
State A has a rule declaration referencing State C if some condition is met. On runtime, this would not currently work.
Proposed solutions are as follows:
Produce an error/assert indicating that an invalid state would be reached
Ignore rules pointing to invalid/missing states (Probably best to detect this dynamically, since you could theoretically add to the entity-descriptor during runtime)
Statically scan the names of all transition states, implicitly importing them due to being referenced in a rule. (This is problematic, since we don't have actual state paths, only state names)
Allow states to declare their imports in a dedicated "states" or "imports" section. (This would also allow for exact paths to be used, rather than hoping we can directly resolve by state-name)
Allow for an in-line import directive for the referenced state, allowing for an exact path to be provided.
I am currently undecided on which approach would be most effective, but I'm leaning towards an "imports" section for each state.
We currently require that all states be declared during the archetype parsing phase. This feature would allow importing additional states to the entity-descriptor if they're referenced as possible transition states in one of the regularly imported state definitions.
Example:
Proposed solutions are as follows:
I am currently undecided on which approach would be most effective, but I'm leaning towards an "imports" section for each state.