public class FSM
{
// 定义函数指针类型
public delegate void FSMTranslationCallfunc(); /// <summary>
/// 状态类
/// </summary>
public class FSMState
{
public string name;
public FSMState(string name)
{
this.name = name;
}
/// <summary>
/// 存储事件对应的条转
/// </summary>
public Dictionary<string, FSMTranslation> TranslationDict = new Dictionary<string, FSMTranslation>();
}
/// <summary>
/// 跳转类
/// </summary>
public class FSMTranslation
{
public FSMState fromState;
public string name;
public FSMState toState;
public FSMTranslationCallfunc callfunc; // 回调函数
public FSMTranslation(FSMState fromState, string name, FSMSta
有限状态机(源自QFramework框架教程)
最新推荐文章于 2024-09-19 11:18:08 发布