31 std::map<int, AbilityInfo *> mAbilityInfos;
41 if (str ==
"direction")
44 Log::info(
"AbilityDB: Warning, unknown target mode \"%s\"", str.c_str() );
60 info->name = node.
getProperty(
"name", std::string());
61 info->icon = node.
getProperty(
"icon", std::string());
62 info->useAction = node.
getProperty(
"useaction", std::string());
64 info->targetMode = targetModeFromString(node.
getProperty(
"target",
"being"));
67 info->rechargeNeeded = 0;
68 info->rechargeCurrent = 0;
70 if (mAbilityInfos.find(
id) != mAbilityInfos.end())
71 Log::info(
"AbilityDB: Duplicate ability ID %d in %s, ignoring",
id, filename.c_str());
73 mAbilityInfos[id] = info;
84 mAbilityInfos.clear();
91 auto i = mAbilityInfos.find(
id);
92 if (i != mAbilityInfos.end())
100 for (
auto &[
_, abilityInfo] : mAbilityInfos)
102 if (abilityInfo->name == name)
int getProperty(const char *name, int def) const
bool getBoolProperty(const char *name, bool def) const
void delete_all(Container &c)
AbilityInfo * find(std::string_view name)
Finds an ability by name.
AbilityInfo * get(int id)
Gets the ability info for ID.
void readAbilityNode(XML::Node node, const std::string &filename)
void info(const char *log_text,...) LOG_PRINTF_ATTR