Files
Frostbite2D/Game/include/character/states/jobs/swordman/SwordmanAttackState.h
Lenheart 5e80df040b feat(animation): 添加动画状态回调支持
refactor(character): 重构角色动作处理逻辑

feat(swordman): 实现剑士基础攻击和技能1处理

refactor(state): 优化状态机与动作上下文管理

feat(input): 改进输入系统支持动作请求队列

refactor(movement): 重构移动系统支持行走/奔跑模式
2026-04-04 14:45:41 +08:00

33 lines
1.0 KiB
C++

#pragma once
#include "character/states/CharacterStateBase.h"
#include "character/states/jobs/swordman/SwordmanActionHandler.h"
#include <memory>
#include <string>
#include <unordered_map>
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;
private:
ISwordmanActionHandler* FindHandler(const std::string& actionId) const;
std::unordered_map<std::string, std::unique_ptr<ISwordmanActionHandler>> handlers_;
};
} // namespace frostbite2D