feat(npc): 添加NPC数据加载、动画和对象功能
实现NPC系统的核心功能,包括: 1. 新增NpcDataLoader用于加载NPC索引和配置数据 2. 添加NpcAnimation处理NPC动画显示 3. 创建NpcObject实现NPC交互和显示逻辑 4. 在GameMapTestScene中集成测试NPC功能
This commit is contained in:
20
Game/include/npc/NpcDataLoader.h
Normal file
20
Game/include/npc/NpcDataLoader.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
namespace frostbite2D::npc {
|
||||
|
||||
struct NpcConfig {
|
||||
int id = -1;
|
||||
std::string path;
|
||||
std::string name;
|
||||
std::string fieldName;
|
||||
std::string fieldAnimationPath;
|
||||
};
|
||||
|
||||
bool loadNpcIndex(std::map<int, std::string>& outIndex);
|
||||
std::optional<NpcConfig> loadNpcConfig(int npcId);
|
||||
|
||||
} // namespace frostbite2D::npc
|
||||
Reference in New Issue
Block a user