本文整理汇总了C++中Enum::AddMember方法的典型用法代码示例。如果您正苦于以下问题:C++ Enum::AddMember方法的具体用法?C++ Enum::AddMember怎么用?C++ Enum::AddMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enum
的用法示例。
在下文中一共展示了Enum::AddMember方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildUpdateFieldEnum
void UpdateFieldDumper::BuildUpdateFieldEnum(Enum& enumData, std::string const& name, std::vector<UpdateField> const& data, std::string const& end, std::string const& fieldBase)
{
enumData.SetName(name);
std::uint32_t i = 0;
while (i < data.size())
{
UpdateField const* field = &data[i];
std::string name = GetInputData()->GetString(data[i].NameAddress);
if (name == "CGUnitData::npcFlags[UMNW0]")
{
name = "CGUnitData::npcFlags";
field = &data[i + 1];
}
std::string oldName = GetOldName(name.c_str());
if (!oldName.empty())
name = oldName;
enumData.AddMember(Enum::Member(i, FormatValue(i, fieldBase), name,
static_cast<std::ostringstream&>(std::ostringstream() << "Size: " << field->Size << ", Flags: " << GetUpdateFieldFlagName(field->Flags)).str()));
i += field->Size;
}
enumData.AddMember(Enum::Member(i, FormatValue(i, fieldBase), end, ""));
}
示例2: BuildDynamicUpdateFieldEnum
void UpdateFieldDumper::BuildDynamicUpdateFieldEnum(Enum& enumData, std::string const& name, std::vector<DynamicUpdateField> const& data, std::string const& end, std::string const& fieldBase)
{
enumData.SetName(name);
std::uint32_t i = 0;
while (i < data.size())
{
DynamicUpdateField const* field = &data[i];
std::string name = GetInputData()->GetString(data[i].NameAddress);
std::string oldName = GetOldName(name.c_str());
if (!oldName.empty())
name = oldName;
enumData.AddMember(Enum::Member(i, FormatValue(i, fieldBase), name,
static_cast<std::ostringstream&>(std::ostringstream() << "Flags: " << GetUpdateFieldFlagName(field->Flags)).str()));
++i;
}
enumData.AddMember(Enum::Member(i, FormatValue(i, fieldBase), end, ""));
}
示例3: DumpFrameXML_Events
void DumpFrameXML_Events(std::shared_ptr<Process> wow)
{
static std::uintptr_t const FrameXML_EventsOffset = 0xE66430;
static std::size_t const FrameXML_EventsSize = 1054;
Enum frameXML;
frameXML.SetName("FrameXML_Events");
std::vector<char const*> events = wow->ReadArray<char const*>(FrameXML_EventsOffset, FrameXML_EventsSize);
for (std::size_t i = 0; i < events.size(); ++i)
{
std::string evt = wow->Read<std::string>(events[i]);
if (!evt.empty())
frameXML.AddMember(Enum::Member(i, evt, ""));
}
DumpEnum(frameXML, "FrameXML_Events");
}
示例4: DumpUIErrors
void DumpUIErrors(std::shared_ptr<Process> wow)
{
static std::uintptr_t const UIErrorsOffset = 0xCB01D0;
static std::size_t const UIErrorsSize = 945;
Enum uiErrors;
uiErrors.SetName("GAME_ERROR_TYPE");
std::vector<UIErrorInfo> errors = wow->ReadArray<UIErrorInfo>(UIErrorsOffset, UIErrorsSize);
for (std::size_t i = 0; i < errors.size(); ++i)
{
std::string error = wow->Read<std::string>(errors[i].ErrorName);
if (!error.empty())
uiErrors.AddMember(Enum::Member(i, error, ""));
}
DumpEnum(uiErrors, "UIErrors");
}