31 unsigned mMinHairColor = 0;
32 unsigned mMaxHairColor = 0;
33 unsigned mMinHairStyle = 0;
34 unsigned mMaxHairStyle = 0;
35 unsigned mMinStat = 0;
36 unsigned mMaxStat = 0;
37 unsigned mSumStat = 0;
38 std::vector<int> mDefaultItems;
41static void loadMinMax(
XML::Node node,
unsigned *min,
unsigned *max)
55 if (!root || root.
name() !=
"chars")
57 Log::info(
"CharDB: Failed to parse charcreation.xml.");
63 if (node.
name() ==
"haircolor")
65 loadMinMax(node, &mMinHairColor, &mMaxHairColor);
67 else if (node.
name() ==
"hairstyle")
69 loadMinMax(node, &mMinHairStyle, &mMaxHairStyle);
71 else if (node.
name() ==
"stat")
73 loadMinMax(node, &mMinStat, &mMaxStat);
76 else if (node.
name() ==
"item")
80 mDefaultItems.push_back(
id);
101 return mMaxHairColor;
106 return mMinHairStyle;
111 return mMaxHairStyle;
131 return mDefaultItems;
A helper class for parsing an XML document, which also cleans it up again (RAII).
Node rootNode() const
Returns the root node of the document (or NULL if there was a load error).
std::string_view name() const
int getProperty(const char *name, int def) const
Children children() const
unsigned getMinHairStyle()
unsigned getMaxHairStyle()
unsigned getMaxHairColor()
unsigned getMinHairColor()
const std::vector< int > & getDefaultItems()
void info(const char *log_text,...) LOG_PRINTF_ATTR