This commit is contained in:
@@ -22,36 +22,40 @@ namespace Porygon::UserData {
|
||||
_obj = obj;
|
||||
}
|
||||
|
||||
inline const TypeClass GetTypeClass() const final {
|
||||
[[nodiscard]]
|
||||
inline TypeClass GetTypeClass() const final {
|
||||
return TypeClass::UserData;
|
||||
}
|
||||
|
||||
const bool operator==(EvalValue *b) const final {
|
||||
bool operator==(const EvalValue *b) const final {
|
||||
if (b->GetTypeClass() != TypeClass::UserData)
|
||||
return false;
|
||||
return _obj == ((UserDataValue *) b)->_obj;
|
||||
}
|
||||
|
||||
inline const shared_ptr<EvalValue> Clone() const final {
|
||||
[[nodiscard]]
|
||||
inline shared_ptr<const EvalValue> Clone() const final {
|
||||
return make_shared<UserDataValue>(_userData, _obj);
|
||||
}
|
||||
|
||||
inline const std::size_t GetHashCode() const final {
|
||||
[[nodiscard]]
|
||||
inline std::size_t GetHashCode() const final {
|
||||
return reinterpret_cast<intptr_t>(_obj);
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(EvalValue *val) const final {
|
||||
shared_ptr<const EvalValue> IndexValue(const EvalValue *val) const final {
|
||||
auto fieldId = val->GetHashCode();
|
||||
auto field = _userData->GetField(fieldId);
|
||||
return shared_ptr<EvalValue>(field->Get(_obj));
|
||||
return shared_ptr<const EvalValue>(field->Get(_obj));
|
||||
}
|
||||
|
||||
inline const shared_ptr<EvalValue> IndexValue(uint32_t hash) const final {
|
||||
[[nodiscard]]
|
||||
inline shared_ptr<const EvalValue> IndexValue(uint32_t hash) const final {
|
||||
auto field = _userData->GetField(hash);
|
||||
return shared_ptr<EvalValue>(field->Get(_obj));
|
||||
return shared_ptr<const EvalValue>(field->Get(_obj));
|
||||
}
|
||||
|
||||
void SetIndexValue(EvalValue *key, const shared_ptr<EvalValue> &value) const final {
|
||||
void SetIndexValue(const EvalValue *key, const shared_ptr<const EvalValue> &value) const final {
|
||||
auto fieldId = key->GetHashCode();
|
||||
auto field = _userData->GetField(fieldId);
|
||||
field->Set(_obj, value.get());
|
||||
|
||||
Reference in New Issue
Block a user