Files
ProjectEleri/Source/ProjectEleri/Data/BazarSettingsDataAsset.cpp

42 lines
862 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "BazarSettingsDataAsset.h"
void UBazarSettingsDataAsset::PostLoad()
{
Super::PostLoad();
}
int32 UBazarSettingsDataAsset::GetCostOfUpgrade(const FGameplayTag& Tag, const int32 Level)
{
if (!Tag.IsValid() || Level > 10 || Level < 0) return 0;
for (auto Upgrade : UpgradeArray)
{
if (Tag == Upgrade.UpgradeTag)
{
return Upgrade.UpgradeCostCurve.GetRichCurveConst()->Eval(Level);
}
}
return 0;
}
float UBazarSettingsDataAsset::GetUpgradeBenefitAmount(const FGameplayTag& Tag, const int32 Level)
{
if (!Tag.IsValid() || Level > 10 || Level < 0) return 0.f;
for (const FBazaarUpgradeData& Upgrade : UpgradeArray)
{
if (Tag == Upgrade.UpgradeTag)
{
return Upgrade.UpgradeBenefitCurve.GetRichCurveConst()->Eval(Level);
}
}
return 0.f;
}