1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 05:23:04 +01:00

Use simple identifiers

This commit is contained in:
Ted John
2023-04-20 21:50:29 +01:00
parent bf3c6964be
commit 58dc3f193b
3 changed files with 35 additions and 78 deletions

View File

@@ -80,6 +80,24 @@ std::string_view ObjectEntryDescriptor::GetName() const
return Generation == ObjectGeneration::JSON ? Identifier : Entry.GetName();
}
std::string ObjectEntryDescriptor::ToString() const
{
if (Generation == ObjectGeneration::DAT)
{
char buffer[32];
std::snprintf(&buffer[0], 9, "%08X", Entry.flags);
buffer[8] = '|';
std::memcpy(&buffer[9], Entry.name, 8);
buffer[17] = '|';
std::snprintf(&buffer[18], 9, "%8X", Entry.checksum);
return std::string(buffer);
}
else
{
return std::string(GetName());
}
}
bool ObjectEntryDescriptor::operator==(const ObjectEntryDescriptor& rhs) const
{
if (Generation != rhs.Generation)