using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AsyncStateMachine; namespace ServerCore; public static class HFSMHelper { public static bool isChangedState(this Transition transition) where TTrigger : struct where TState : struct { if(null == transition) { return false; } if(true == transition.Source.Equals(transition.Destination)) { return false; } return true; } public static string toBasicString(this Transition transition) where TTrigger : struct where TState : struct { return $"Transition: from:{transition.Source} => to:{transition.Destination} - Trigger:{transition.Trigger.ToString()}"; } }