Class IZagalaSpecTaggedDataCacher#
Defined in File ZagalaSpecTaggedDataCacher.h
Inheritance Relationships#
Derived Type#
public UZagalaSpecTaggedDataCache(Class UZagalaSpecTaggedDataCache)
Class Documentation#
-
class IZagalaSpecTaggedDataCacher#
Interface for objects that own a tagged data cache.
Implementors expose access to their TMap<FGameplayTag, TObjectPtr<UZagalaSpecTaggedData>> cache, allowing stateless utilities such as UZagalaSpecTaggedDataHandler to operate on any caching object without coupling to a specific concrete type.
Usage: class UMyContext : public UObject, public IZagalaSpecTaggedDataCacher { virtual const TMap<FGameplayTag, TObjectPtr<UZagalaSpecTaggedData>>& GetTaggedDataCache() const override { return MyCache; } };
Subclassed by UZagalaSpecTaggedDataCache
Public Functions
-
virtual const TMap<FGameplayTag, TObjectPtr<UZagalaSpecTaggedData>> &GetTaggedDataCache() const = 0#
Returns a const reference to the tagged data cache owned by this object.
- Returns:
A const reference to the tag-to-data cache map.
-
virtual TMap<FGameplayTag, TObjectPtr<UZagalaSpecTaggedData>> &GetTaggedDataCache() = 0#
Returns a non-const reference to the tagged data cache owned by this object.
- Returns:
A mutable reference to the tag-to-data cache map.
-
virtual UZagalaSpecTaggedData *GetTaggedData(FGameplayTag Tag) const#
Returns the tagged data entry associated with the given tag, or nullptr if not found.
Override with UFUNCTION(BlueprintCallable) in Blueprintable implementing classes.
- Parameters:
Tag – The gameplay tag key to look up.
- Returns:
The tagged data object, or nullptr if not present in the cache.
-
virtual void SetTaggedData(UZagalaSpecTaggedData *Data)#
Sets the tagged data entry associated with the given tag.
If an entry with the same tag already exists, it will be overwritten.
- Parameters:
Data – The tagged data object to add to the cache.
-
virtual void RemoveTaggedData(FGameplayTag Tag)#
Removes the tagged data entry associated with the given tag.
If no entry exists for the tag, this is a no-op.
- Parameters:
Tag – The gameplay tag key to remove from the cache.
-
virtual bool HasTaggedData(FGameplayTag Tag) const#
Checks if the cache contains an entry for the given tag.
- Parameters:
Tag – The gameplay tag key to check for.
- Returns:
true if an entry exists for the tag, false otherwise.
-
virtual void ResetCache(UObject *CacheOwner)#
Clears all entries from the tagged data cache.
Marks entries as garbage for cleanup if CacheOwner is valid. Only entries owned by the specified CacheOwner will be marked for garbage collection. Only entries that are not the class default object will be marked for garbage collection.
- Parameters:
CacheOwner – The UObject that owns the cache entries to be cleared.
-
virtual void CopyFrom(const UObject *Other)#
Copies all entries from Other’s cache into this cache.
Other must implement IZagalaSpecTaggedDataCacher; passing null or a non-cacher object is a no-op. On tag collision the incoming entry overwrites the existing one. This does not make a deep copy of the tagged data objects; both caches will reference the same UZagalaSpecTaggedData instances. This does not move or delete entries from Other’s cache; it only copies references. The other cache still owns its entries.
- Parameters:
Other – The source object whose cache will be merged into this cache.
-
virtual const TMap<FGameplayTag, TObjectPtr<UZagalaSpecTaggedData>> &GetTaggedDataCache() const = 0#