Interface IScyllaTransition<TContext>
A condition-driven transition toward a target state, evaluated by a ScyllaStateMachine<TContext> when registered as a global transition via AddGlobalTransition(IScyllaTransition<TContext>).
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public interface IScyllaTransition<TContext>
Type Parameters
| Name | Description |
|---|---|
| TContext | The shared context type of the machine the transition belongs to. |
Remarks
Evaluate(TContext) must be side-effect-free and must not initiate transitions itself; the owning machine performs the transition when the condition holds. Global transitions are evaluated in descending Priority order at the start of every machine tick, and at most one fires per tick.
Properties
Priority
Gets the evaluation priority. Higher priorities are evaluated first; transitions of equal priority keep their registration order.
Declaration
int Priority { get; }
Property Value
| Type | Description |
|---|---|
| int |
Target
Gets the state the machine transitions to when Evaluate(TContext) holds.
Declaration
IScyllaState<TContext> Target { get; }
Property Value
| Type | Description |
|---|---|
| IScyllaState<TContext> |
Methods
Evaluate(TContext)
Returns whether the transition should fire. Must be side-effect-free.
Declaration
bool Evaluate(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
Returns
| Type | Description |
|---|---|
| bool |
|