Use ESM::RefId as key in TestInterpreterContext::mMembers

depth-refraction
elsid 2 years ago
parent 3c9dbb11cc
commit eb17f0ba06
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -144,7 +144,7 @@ namespace
class TestInterpreterContext : public Interpreter::Context
{
LocalVariables mLocals;
std::map<std::string, GlobalVariables, Misc::StringUtils::CiComp> mMembers;
std::map<ESM::RefId, GlobalVariables> mMembers;
public:
const ESM::RefId& getTarget() const override { return ESM::RefId::sEmpty; }
@ -209,7 +209,7 @@ namespace
int getMemberShort(const ESM::RefId& id, std::string_view name, bool global) const override
{
auto it = mMembers.find(id.getRefIdString());
auto it = mMembers.find(id);
if (it != mMembers.end())
return it->second.getShort(name);
return {};
@ -217,7 +217,7 @@ namespace
int getMemberLong(const ESM::RefId& id, std::string_view name, bool global) const override
{
auto it = mMembers.find(id.getRefIdString());
auto it = mMembers.find(id);
if (it != mMembers.end())
return it->second.getLong(name);
return {};
@ -225,7 +225,7 @@ namespace
float getMemberFloat(const ESM::RefId& id, std::string_view name, bool global) const override
{
auto it = mMembers.find(id.getRefIdString());
auto it = mMembers.find(id);
if (it != mMembers.end())
return it->second.getFloat(name);
return {};
@ -233,17 +233,17 @@ namespace
void setMemberShort(const ESM::RefId& id, std::string_view name, int value, bool global) override
{
mMembers[id.getRefIdString()].setShort(name, value);
mMembers[id].setShort(name, value);
}
void setMemberLong(const ESM::RefId& id, std::string_view name, int value, bool global) override
{
mMembers[id.getRefIdString()].setLong(name, value);
mMembers[id].setLong(name, value);
}
void setMemberFloat(const ESM::RefId& id, std::string_view name, float value, bool global) override
{
mMembers[id.getRefIdString()].setFloat(name, value);
mMembers[id].setFloat(name, value);
}
};

Loading…
Cancel
Save