Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EventNode.cs
1using System.Threading.Tasks;
4
6{
10 public abstract class EventNode : StateMachineNode
11 {
15 public EventNode()
16 : base()
17 {
18 }
19
23 public abstract string Label { get; }
24
34 public abstract Task<EventHandlerReference> Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event);
35
41 public virtual Task Unregister(int EventIndex, EvaluationArguments Arguments)
42 {
43 return Task.CompletedTask; // Do nothing by default.
44 }
45
53 public virtual Task<EventHandlerReference> StateUpdated(EvaluationArguments Arguments)
54 {
55 return Task.FromResult<EventHandlerReference>(null);
56 }
57
63 public virtual Task<bool> Applies(EvaluationArguments Arguments)
64 {
65 return Task.FromResult(true);
66 }
67 }
68}
Contains information required for evaluating script in a state-machine.
Abstract base class for State-Machine event nodes.
Definition: EventNode.cs:11
abstract Task< EventHandlerReference > Register(int EventIndex, EvaluationArguments Arguments, OnEvent Event)
Registers the event
virtual Task< bool > Applies(EvaluationArguments Arguments)
If the event node applies to the current context.
Definition: EventNode.cs:63
virtual Task< EventHandlerReference > StateUpdated(EvaluationArguments Arguments)
Method called when the internal state of the state-machine has been updated.
Definition: EventNode.cs:53
virtual Task Unregister(int EventIndex, EvaluationArguments Arguments)
Unregisters the event
Definition: EventNode.cs:41
EventNode()
Abstract base class for State-Machine event nodes.
Definition: EventNode.cs:15
Abstract base class for State-Machine nodes.
Action executed when entering a state.
Definition: OnEvent.cs:19