17 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardBackground"))
20 for (
const auto& row : *tbl)
21 unique.insert(
static_cast<int>(row.getUInt(
"Color")));
25 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardEmblem"))
28 for (
const auto& row : *tbl)
29 unique.insert(
static_cast<int>(row.getUInt(
"EmblemID")));
30 icons.assign(unique.begin(), unique.end());
33 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardBorder"))
36 for (
const auto& row : *tbl)
37 unique.insert(
static_cast<int>(row.getUInt(
"BorderID")));
38 borders.assign(unique.begin(), unique.end());
44 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardBackground"))
46 for (
const auto& row : *tbl)
48 if (
static_cast<int>(row.getUInt(
"Color")) ==
backgroundId &&
49 static_cast<int>(row.getUInt(
"Tier")) ==
tier &&
50 static_cast<int>(row.getUInt(
"Component")) == slot)
59 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardBorder"))
61 for (
const auto& row : *tbl)
63 if (
static_cast<int>(row.getUInt(
"BorderID")) ==
borderId &&
64 static_cast<int>(row.getUInt(
"Color")) ==
borderColor &&
65 static_cast<int>(row.getUInt(
"Tier")) ==
tier &&
66 static_cast<int>(row.getUInt(
"Component")) == slot)
75 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardEmblem"))
77 for (
const auto& row : *tbl)
79 if (
static_cast<int>(row.getUInt(
"EmblemID")) ==
iconId &&
80 static_cast<int>(row.getUInt(
"Color")) ==
iconColor &&
81 static_cast<int>(row.getUInt(
"Component")) == slot)
95 return static_cast<int>(
icons.size());
100 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardEmblem"))
102 std::set<int> uniqueColors;
103 for (
const auto& row : *tbl)
104 if (
static_cast<int>(row.getUInt(
"EmblemID")) == icon)
105 uniqueColors.insert(
static_cast<int>(row.getUInt(
"Color")));
106 return static_cast<int>(uniqueColors.size());
113 return static_cast<int>(
borders.size());
118 if (
const DB2Table* tbl =
WOWDB.getTable(
"GuildTabardBorder"))
120 std::set<int> uniqueColors;
121 for (
const auto& row : *tbl)
122 if (
static_cast<int>(row.getUInt(
"BorderID")) == border)
123 uniqueColors.insert(
static_cast<int>(row.getUInt(
"Color")));
124 return static_cast<int>(uniqueColors.size());
131 pugi::xml_node node = parentNode.append_child(
"TabardDetails");
133 node.append_child(
"Icon").append_attribute(
"value") =
iconId;
134 node.append_child(
"IconColor").append_attribute(
"value") =
iconColor;
135 node.append_child(
"Border").append_attribute(
"value") =
borderId;
136 node.append_child(
"BorderColor").append_attribute(
"value") =
borderColor;
137 node.append_child(
"Background").append_attribute(
"value") =
backgroundId;
142 for (pugi::xml_node child = node.first_child(); child; child = child.next_sibling())
144 const std::string name = child.
name();
147 iconId = child.attribute(
"value").as_int();
148 else if (name ==
"IconColor")
149 iconColor = child.attribute(
"value").as_int();
150 else if (name ==
"Border")
151 borderId = child.attribute(
"value").as_int();
152 else if (name ==
"BorderColor")
154 else if (name ==
"Background")
213 else if (itemid == 69209)
Provides typed, field-name-based access to records in a WDC DB2 file.
Abstract base class representing a file within the game data archive.
GameFile * GetBorderTex(int slot)
GameFile * GetIconTex(int slot)
std::vector< int > backgrounds
void setBackgroundId(int id)
void setBackground(int background)
std::vector< int > borders
int GetMaxIconColor(int icon)
void setIconColor(int color)
void setTabardId(int itemid)
void load(const pugi::xml_node &node)
void setBorder(int border)
void setBorderColor(int color)
void save(pugi::xml_node &parentNode)
int GetMaxBorderColor(int border)
GameFile * GetBackgroundTex(int slot)