33 std::map<int, BeingInfo *> mNPCInfos;
49 Log::info(
"NPC Database: NPC with missing ID in %s", filename.c_str());
56 currentInfo->setHoverCursor(node.
getProperty(
"hoverCursor",
"talk"));
58 currentInfo->targetSelection = node.
getProperty(
"targetSelection",
true);
61 for (
auto spriteNode : node.
children())
63 if (spriteNode.name() ==
"sprite")
66 currentSprite.
sprite = spriteNode.textContent();
67 currentSprite.
variant = spriteNode.getProperty(
"variant", 0);
69 else if (spriteNode.name() ==
"particlefx")
71 display.
particles.emplace_back(spriteNode.textContent());
75 mNPCInfos[id] = currentInfo;
93 auto i = mNPCInfos.find(
id);
95 if (i == mNPCInfos.end())
97 Log::info(
"NPCDB: Warning, unknown NPC ID %d requested",
id);
Holds information about a certain type of monster.
static BeingInfo * Unknown
void setTargetCursorSize(const std::string &size)
int getProperty(const char *name, int def) const
Children children() const
void delete_all(Container &c)
void info(const char *log_text,...) LOG_PRINTF_ATTR
void readNPCNode(XML::Node node, const std::string &filename)
std::vector< SpriteReference > sprites
std::vector< std::string > particles