feat(角色状态机): 重构角色状态系统为基于类的设计

新增通用状态类和职业专属状态类,将状态逻辑从状态机中解耦
添加状态注册机制,支持按职业配置状态
实现基础状态如待机、移动、跳跃、受击等
为剑士职业实现专属攻击状态
补充状态机开发说明文档
This commit is contained in:
2026-04-03 17:11:22 +08:00
parent de522a1e64
commit f64180ebed
25 changed files with 1658 additions and 235 deletions

View File

@@ -44,11 +44,15 @@ public:
const CharacterWorldPosition& GetWorldPosition() const { return motor_.position; }
const CharacterMotor& GetMotor() const { return motor_; }
CharacterMotor& GetMotorMutable() { return motor_; }
CharacterCommandBuffer& GetCommandBufferMutable() { return commandBuffer_; }
float GetLastDeltaTime() const { return lastDeltaTime_; }
const CharacterActionDefinition* FindAction(const std::string& actionId) const;
std::string ResolveAnimationTag(const std::string& preferred,
const std::string& fallback) const;
void PlayAnimationTag(const std::string& actionTag);
void RunStateHook(const std::string& phase,
CharacterStateId stateId,
const CharacterActionDefinition* action);
void SetFacing(int direction);
const character::CharacterConfig* GetConfig() const {