找回密码
 立即注册
搜索

[编辑器/功能拓展] Finite State Machine System 1.0

[复制链接]
167 |0
发表于 2023-6-16 14:03:07 | 显示全部楼层 |阅读模式




















This Finite State Machine System is much more professional, and is developed for the programmer who has previous knowledge about the finite state machine concept.

Features
- You can create your own state classes derived from the FSMState class in the framework and override its OnEnter(),OnUpdate() and OnExit() functions if necessary.No more silly enums and switch cases!
-One state linked to another,is created by the transition class,in other words,the transition class link one state to another state called the next state,besides, it hold the next state reference and a list of condition which determine whether to change to next state or not.
- In this framework,each condition class is separated,and you should create your own condition by Implement the condition interface : IFSMTransitionCondition.
- When you want to link one state to another, you don't need to create the transition by yourself,just to use the CreateFSMStateToAnotherFSMStateTransition API in this framework,all you need to do is to input two state names and some conditions,the framework will create a transition between two states automatically.
- There is a simple tank battle demo in this package,the AI tank is implemented by this finite state machine framework.so you can easy to learn how to use this framework by studying the code in the demo.
- In this package,the readme file described about how to use this framework and how the AI tank in demo be coded in detail.


这个有限状态机系统更加专业,是为那些对有限状态机概念有一定了解的程序员开发的。

特性
-你可以在框架中创建自己的状态类,派生自FSMState类,并在必要时覆盖其OnEnter(),OnUpdate()和OnExit()函数。不再有愚蠢的枚举和开关箱!
一个状态链接到另一个状态,是由转换类创建的,换句话说,转换类将一个状态链接到另一个称为下一个状态的状态,此外,它保存下一个状态引用和决定是否更改到下一个状态的条件列表。
在这个框架中,每个条件类都是分开的,你应该通过实现条件接口IFSMTransitionCondition来创建你自己的条件。
-当你想链接一个状态到另一个状态时,你不需要自己创建转换,只需要在这个框架中使用CreateFSMStateToAnotherFSMStateTransition API,你所需要做的就是输入两个状态名称和一些条件,框架将自动创建两个状态之间的转换。
-在这个包里有一个简单的坦克战斗演示,AI坦克是由这个有限状态机框架实现的。因此,通过研究演示中的代码,您可以轻松地学习如何使用该框架。
在这个包中,自述文件描述了如何使用这个框架,以及如何详细编码演示中的AI坦克。





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表