From df1dfbec36446ea89eb3f8fdfd055256969b3f86 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 16 Apr 2021 15:47:26 +0200 Subject: [PATCH] Add support for object reference wrappers usage in hash maps and dictionaries (cherry picked from commit eab3631c334ce31038ee6eea8d72cea52635bb00) --- Source/Engine/Content/AssetReference.h | 6 ++++++ Source/Engine/Content/WeakAssetReference.h | 6 ++++++ Source/Engine/Scripting/ScriptingObjectReference.h | 6 ++++++ Source/Engine/Scripting/SoftObjectReference.h | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/Source/Engine/Content/AssetReference.h b/Source/Engine/Content/AssetReference.h index 40f57337d..0956e82be 100644 --- a/Source/Engine/Content/AssetReference.h +++ b/Source/Engine/Content/AssetReference.h @@ -274,3 +274,9 @@ public: OnSet(asset); } }; + +template +uint32 GetHash(const AssetReference& key) +{ + return GetHash(key.GetID()); +} diff --git a/Source/Engine/Content/WeakAssetReference.h b/Source/Engine/Content/WeakAssetReference.h index 4943fd0b5..49401bf25 100644 --- a/Source/Engine/Content/WeakAssetReference.h +++ b/Source/Engine/Content/WeakAssetReference.h @@ -229,3 +229,9 @@ public: OnSet(asset); } }; + +template +uint32 GetHash(const WeakAssetReference& key) +{ + return GetHash(key.GetID()); +} diff --git a/Source/Engine/Scripting/ScriptingObjectReference.h b/Source/Engine/Scripting/ScriptingObjectReference.h index eeed0dcc4..fd132d308 100644 --- a/Source/Engine/Scripting/ScriptingObjectReference.h +++ b/Source/Engine/Scripting/ScriptingObjectReference.h @@ -318,3 +318,9 @@ public: OnSet(object); } }; + +template +uint32 GetHash(const ScriptingObjectReference& key) +{ + return GetHash(key.GetID()); +} diff --git a/Source/Engine/Scripting/SoftObjectReference.h b/Source/Engine/Scripting/SoftObjectReference.h index b6f08db4a..e03ee81d0 100644 --- a/Source/Engine/Scripting/SoftObjectReference.h +++ b/Source/Engine/Scripting/SoftObjectReference.h @@ -326,3 +326,9 @@ public: OnSet(object); } }; + +template +uint32 GetHash(const SoftObjectReference& key) +{ + return GetHash(key.GetID()); +}