mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-12-27 13:44:11 +08:00
22 lines
472 B
C++
22 lines
472 B
C++
#pragma once
|
|
|
|
struct InfoForExtension
|
|
{
|
|
const char* name;
|
|
int64_t value;
|
|
};
|
|
|
|
struct SentenceInfo
|
|
{
|
|
const InfoForExtension* infoArray;
|
|
int64_t operator[](std::string_view propertyName)
|
|
{
|
|
for (auto info = infoArray; info->name; ++info) // nullptr name marks end of info array
|
|
if (propertyName == info->name) return info->value;
|
|
return *(int*)0xDEAD = 0; // gives better error message than alternatives
|
|
}
|
|
};
|
|
|
|
struct SKIP {};
|
|
inline void Skip() { throw SKIP(); }
|