mirror of
https://github.com/johndoe6345789/ArenaFPS.git
synced 2026-04-25 22:25:26 +00:00
26 lines
584 B
C++
26 lines
584 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "InventoryFragment_SetStats.h"
|
|
|
|
#include "Inventory/LyraInventoryItemInstance.h"
|
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(InventoryFragment_SetStats)
|
|
|
|
void UInventoryFragment_SetStats::OnInstanceCreated(ULyraInventoryItemInstance* Instance) const
|
|
{
|
|
for (const auto& KVP : InitialItemStats)
|
|
{
|
|
Instance->AddStatTagStack(KVP.Key, KVP.Value);
|
|
}
|
|
}
|
|
|
|
int32 UInventoryFragment_SetStats::GetItemStatByTag(FGameplayTag Tag) const
|
|
{
|
|
if (const int32* StatPtr = InitialItemStats.Find(Tag))
|
|
{
|
|
return *StatPtr;
|
|
}
|
|
|
|
return 0;
|
|
}
|