private void SwitchStopTriggerHandler(TriggerActionArgs args) { var context = args.Context; var effect = args.Trigger.Effect; context.ChangeState(StopState.Instance, effect); }
private void SubContextTriggerHandler(TriggerActionArgs args) { var trigger = args.Trigger; var context = this.SubContext; context.SendTrigger(trigger); }
public void SendTrigger(StateMachine context, Trigger trigger) { if (this.TriggerActionMap.ContainsKey(trigger.Name) == true) { Messenger.Send($"Trigger : {trigger.Name}"); var action = this.TriggerActionMap[trigger.Name]; var args = new TriggerActionArgs(context, trigger); action(args); } }
private void SwitchCleanTriggerHandler(TriggerActionArgs args) { var context = args.Context; context.ChangeState(CleanState.Instance); }
private void InitializedTriggerHandler(TriggerActionArgs args) { var context = args.Context; context.ChangeState(StopState.Instance); }
private void SwitchStartTriggerHandler(TriggerActionArgs args) { var context = args.Context; context.ChangeState(RunningState.Instance); }