实现NPC系统的核心功能,包括: 1. 新增NpcDataLoader用于加载NPC索引和配置数据 2. 添加NpcAnimation处理NPC动画显示 3. 创建NpcObject实现NPC交互和显示逻辑 4. 在GameMapTestScene中集成测试NPC功能
21 lines
376 B
C++
21 lines
376 B
C++
#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
|