feat(角色状态机): 重构角色状态系统为基于类的设计
新增通用状态类和职业专属状态类,将状态逻辑从状态机中解耦 添加状态注册机制,支持按职业配置状态 实现基础状态如待机、移动、跳跃、受击等 为剑士职业实现专属攻击状态 补充状态机开发说明文档
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "character/states/CharacterStateBase.h"
|
||||
|
||||
namespace frostbite2D {
|
||||
|
||||
class SwordmanAttackState : public CharacterStateBase, public ICharacterActionStateNode {
|
||||
public:
|
||||
SwordmanAttackState();
|
||||
|
||||
bool TryEnter(CharacterStateMachine& machine,
|
||||
CharacterStateContext& context) override;
|
||||
void OnEnter(CharacterStateMachine& machine,
|
||||
CharacterStateContext& context,
|
||||
CharacterStateId previousState) override;
|
||||
void OnUpdate(CharacterStateMachine& machine,
|
||||
CharacterStateContext& context) override;
|
||||
void OnExit(CharacterStateMachine& machine,
|
||||
CharacterStateContext& context,
|
||||
CharacterStateId nextState) override;
|
||||
};
|
||||
|
||||
} // namespace frostbite2D
|
||||
Reference in New Issue
Block a user