초기커밋
This commit is contained in:
38
ServerCore/State/HFSMHelper.cs
Normal file
38
ServerCore/State/HFSMHelper.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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<TTrigger, TState>(this Transition<TTrigger, TState> 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<TTrigger, TState>(this Transition<TTrigger, TState> transition)
|
||||
where TTrigger : struct
|
||||
where TState : struct
|
||||
{
|
||||
return $"Transition: from:{transition.Source} => to:{transition.Destination} - Trigger:{transition.Trigger.ToString()}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user