Class ScyllaStateBase<TContext>
Convenience base class for IScyllaState<TContext> implementations.
All callbacks are virtual no-ops and CanEnter(TContext) returns true,
so derived states only override the callbacks they need.
Implements
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public abstract class ScyllaStateBase<TContext> : IScyllaState<TContext>
Type Parameters
| Name | Description |
|---|---|
| TContext | The shared context type passed to every state callback. |
Methods
CanEnter(TContext)
Transition guard. The default implementation always allows entry.
Declaration
public virtual bool CanEnter(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
Returns
| Type | Description |
|---|---|
| bool |
|
OnEnter(TContext)
Called when this state becomes the machine's current state. The default implementation does nothing.
Declaration
public virtual void OnEnter(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
OnExit(TContext)
Called when this state stops being the machine's current state. The default implementation does nothing.
Declaration
public virtual void OnExit(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
OnFixedTick(TContext, float)
Called once per machine fixed tick while this state is current. The default implementation does nothing.
Declaration
public virtual void OnFixedTick(TContext context, float fixedDeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
| float | fixedDeltaTime | The fixed step duration in seconds. |
OnTick(TContext, float)
Called once per machine tick while this state is current. The default implementation does nothing.
Declaration
public virtual void OnTick(TContext context, float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context | The machine's shared context. |
| float | deltaTime | The elapsed time in seconds since the previous tick. |