23 #include "CoreMinimal.h"
24 #include "UObject/NoExportTypes.h"
27 #include "BeltSlotCache.generated.h"
32 USTRUCT(BlueprintType)
42 TArray<TWeakObjectPtr<class
UDetail>> Details;
45 FORCEINLINE TSubclassOf<
UDetail> GetDetailType()
const
47 if (Details.Num() == 0)
return nullptr;
54 FORCEINLINE
const TArray<TWeakObjectPtr<class UDetail>>&
GetDetails()
const
74 Details.Reserve(Capacity);
80 FORCEINLINE
void Reset() { Details.Reset(); }
85 bool Fetch(
const TScriptInterface<class ISubjective> Subjective,
86 const TSubclassOf<UDetail> Type);
91 bool Fetch(
const TSubclassOf<UDetail> Type,
92 const TArray<class UDetail *> &InDetails);
The conveyor belt consisting of subjects.
Definition: Belt.h:60
The base subject detail (component) class.
Definition: Detail.h:35
TSubclassOf< UDetail > GetClass() const
Get the detail class.
Definition: Detail.h:76
A detail caching for subjects used in the belts' slots.
Definition: BeltSlotCache.h:34
bool Fetch(const TSubclassOf< UDetail > Type, const TArray< class UDetail * > &InDetails)
Fetch the detail instances from the user-provided list of details.
int32 GetDetailsCount() const
Get the current number of fetched details.
Definition: BeltSlotCache.h:62
FBeltSlotCache()
Create a new belt slot cache instance.
Definition: BeltSlotCache.h:67
const TArray< TWeakObjectPtr< class UDetail > > & GetDetails() const
Get the list of all fetched details.
Definition: BeltSlotCache.h:54
FBeltSlotCache(const int32 Capacity)
Create a new belt slot cache instance.
Definition: BeltSlotCache.h:72
bool Fetch(const TScriptInterface< class ISubjective > Subjective, const TSubclassOf< UDetail > Type)
Fetch the detail instances from the subject.
void Reset()
Clear the cache, without any deallocations.
Definition: BeltSlotCache.h:80