Ok, I’ll post my code, I hope it isn’t too much
StatsComponent.h
#pragma once
#include "Object.h"
#include "CalculationType.h"
#include "StatsComponent.generated.h"
/**
* Class for handling statistics
* Every stat consists of multiple modifiers each with it's own description and type of operation it performs upon the result
* For example, stat Max_health can have modifiers from different sources like as power armor, skills, buffs
* For keeping scores and similar stats that are updated often, don't add gazillion modifiers, but change the base modifier
* Since UPropperties should have garbage collection, there shouldn't be any need to release any memory manually.
*/
UCLASS(Blueprintable, editinlinenew, BlueprintType, ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class TWINSTICK_API UStatsComponent : public UActorComponent
{
GENERATED_BODY()
public:
UStatsComponent(const FObjectInitializer& ObjectInitializer);
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
/**
* Adds a new modifyer to a stat. If stat does not exist, a new one is created
* WARNING, every call to this function will create an object. Use AddToStatBase if ou wish to track fast changing data
*
* @param aStatName - name of the stat being added to
* @param aDescription - description of the stat modifyer that could be presented to the user
* @param aType - type of operation modifier applies to the result
* @param aValue - value to be added
* @return returns a pointer to the newly created item
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
class UStatModifier* AddNewModifierToStat(FName aStatName, FText aDescription, ECalculationType aType, float aValue);
/**
* Adds a new modifyer to a stat, based on an existing stat modifier. If stat does not exist, a new one is created
*
* @param aStatName - name of the stat being added to
* @param aModifier - Pointer to the modifier being created
* @return returns the handle of the modifier
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
void AddExistingModifierToStat(FName aStatName, class UStatModifier* aModifier);
/**
* Sets the value of the stat base. If stat does not exist, a new one is created
*
* @param aStatName - name of the stat being added to
* @param aValue - value to be added
* @return returns true if stat was found and edited
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
bool SetStatBase(FName aStatName, float aValue);
/**
* Removes modifier from a stat by stat modifier handle
*
* @param aStatName - name of the stat being added to
* @param aHandle - handle of the modifier being removed
* @return - true if modifier was correctly erased
*/
//bool RemoveStatModifier(FName aStatName, uint32 aHandle); // removed handles thingy so this is not used
/**
* Removes modifier from a stat by stat modifier pointer
*
* @param aStatName - name of the stat being added to
* @param aModifier - pointer to the modifier that should be inserted
* @return - true if modifier was correctly erased
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
bool RemoveStatModifier(FName aStatName, class UStatModifier* aModifier);
/**
* Removes all the modifiers
*
* @param aStatName - name of the stat for reset
* @param aResetBase - If true, resets base to zero
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
bool ResetStat(FName aStatName, bool aResetBase = true);
/**
* Gets the total value of a stat
*
* @param aStatName - name of the stat for reset
* @param aResetBase - If true, resets base to zero
* @return - the total valueof a stat
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
float GetStatValue(FName aStatName);
/**
* Gets the total value of a stat
*
* @param aStatName - name of the stat for reset
* @param aResetBase - If true, resets base to zero
* @return - the total valueof a stat
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
float GetStatBaseValue(FName aStatName);
/**
* Adds a variable to a bound results list. It will be updated on every recalculation
* WARNING!!!, never forget to call UnbindResultVariable before destroying anobject referencing this
*
* @param aStatName - name of the stat to which variable is bound
* @param aVariable - reference to the variable being added
* @return - true if stat was found and variable added
*/
UFUNCTION(BlueprintCallable, Category = "ValueBinding")
bool BindResultVariable(FName aStatName, float& aVariable);
/**
* Removes a variable from a bound results list. It should always be done before destroying an object ownint the variable
*
* @param aStatName - name of the stat from which variable should be unbound
* @param aVariable - reference to a variable being removed
* @return - true if the variable was correctly removed
*/
UFUNCTION(BlueprintCallable, Category = "StatsModifiers")
bool UnbindResultVariable(FName aStatName, float& aVariable);
/**
* Adds an existing stat. If the stat with the same name exists, bases are added and modifiers are appended to the resulting list
* If the stat does not exist, one is created.
*
* @param aStat - pointer to a stat being added
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddRemove")
void AddStat(class UStat* aStat);
/**
* Removes a stat from the list. If the stat with the same name exists, bases are subtracted and modifiers removed.
* If the stat does not exist, command is ignored
*
* @param aStat - pointer to a stat being removed
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddRemove")
void RemoveStat(class UStat* aStat);
/**
* Adds another statistics object to this one. Bases will be added numericaly, modifiers will be shared to the list of item being added to
*
* @param StatisticsToAdd - name of the stat from which variable should be unbound
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddRemove")
void AddStatistics(UStatsComponent* StatisticsToAdd);
/**
* Removes added statistics object. Base of the subtracting object will be numerically subtracted, modifier objects will be removed from the list.
*
* @param StatisticsToAdd - name of the stat from which variable should be unbound
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddRemove")
void RemoveStatistics(UStatsComponent* StatisticsToAdd);
/**
* Gets a const list of all stats
*
* @return - pointer list to all stats
*/
UFUNCTION(BlueprintPure, Category = "StatsGetter")
TArray <class UStat*> GetStats();
protected:
/**
* Finds the index of a stat by name
*
* @param aStatName - name of the stat to be searched
* @param AIsCreateIfNotFound - if true and if name is not found, it will be added
* @return - Index of the searched object. -1 if not found
*/
int32 GetStatIndex(FName aStatName, bool AIsCreateIfNotFound = false);
/**
* List of stats added to this object
*/
UPROPERTY(EditAnywhere, Instanced, BlueprintReadWrite, Category = "Container")
TArray<class UStat*> Stats;
//TESTING
UPROPERTY(EditAnywhere, instanced, BlueprintReadWrite, Category = "Container")
class AMyActor* Test = nullptr;
};
StatsComponent.h
// Fill out your copyright notice in the Description page of Project Settings.
#include "TwinStick.h"
#include "Stat.h"
#include "StatsComponent.h"
UStatsComponent::UStatsComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
bWantsBeginPlay = true;
PrimaryComponentTick.bCanEverTick = true;
// ...
}
void UStatsComponent::BeginPlay()
{
Super::BeginPlay();
}
void UStatsComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
UStatModifier* UStatsComponent::AddNewModifierToStat(FName aStatName, FText aDescription, ECalculationType aType, float aValue)
{
int32 index = GetStatIndex(aStatName, true);
if (index >= 0)
return Stats[index]->AddNewStatModifier(aDescription, aType, aValue);
else
return nullptr;
//{
// UStat* newStat = NewObject<UStat>(this->StaticClass(), aStatName);
// newStat->SetName(aStatName);
// class UStatModifier* mod = newStat->AddNewStatModifier(aDescription, aType, aValue);
// Stats.Add(newStat);
// return mod;
//}
}
void UStatsComponent::AddExistingModifierToStat(FName aStatName, class UStatModifier * aModifier)
{
int32 index = GetStatIndex(aStatName, true);
if (index >= 0)
Stats[index]->AddExistingStatModifier(aModifier);
//else
//{
// UStat* newStat = NewObject<UStat>(this->StaticClass(), aStatName);
// newStat->SetName(aStatName);
// newStat->AddExistingStatModifier(aModifier);
// Stats.Add(newStat);
//}
}
bool UStatsComponent::SetStatBase(FName aStatName, float aValue)
{
int32 index = GetStatIndex(aStatName, false);
if (index >= 0)
{
Stats[index]->SetBaseValue(aValue);
return true;
}
else
{
UStat* newStat = NewObject<UStat>(this->StaticClass(), aStatName);
newStat->SetName(aStatName);
newStat->SetBaseValue(aValue);
Stats.Add(newStat);
return true;
}
return false;
}
//bool UStatsComponent::RemoveStatModifier(FName aStatName, uint32 aHandle) //removed because handles aren't used
//{
//}
bool UStatsComponent::RemoveStatModifier(FName aStatName, class UStatModifier* aModifier)
{
int32 index = GetStatIndex(aStatName, true);
if (index >= 0)
{
Stats[index]->RemoveStatModifier(aModifier);
return true;
}
return false;
}
bool UStatsComponent::ResetStat(FName aStatName, bool aResetBase)
{
int32 index = GetStatIndex(aStatName);
if (index >= 0)
{
Stats[index]->Reset(aResetBase);
return true;
}
return false;
}
float UStatsComponent::GetStatValue(FName aStatName)
{
int32 index = GetStatIndex(aStatName);
if (index >= 0)
{
return Stats[index]->GetValue();
}
return 0;
}
float UStatsComponent::GetStatBaseValue(FName aStatName)
{
int32 index = GetStatIndex(aStatName);
if (index >= 0)
{
return Stats[index]->GetBaseValue();
}
return 0;
}
bool UStatsComponent::BindResultVariable(FName aStatName, float& aVariable)
{
int32 index = GetStatIndex(aStatName);
if (index >= 0)
{
Stats[index]->BindResultVariable(aVariable);
return true;
}
return false;
}
bool UStatsComponent::UnbindResultVariable(FName aStatName, float & aVariable)
{
int32 index = GetStatIndex(aStatName);
if (index >= 0)
{
Stats[index]->UnbindResultVariable(aVariable);
return true;
}
return false;
}
void UStatsComponent::AddStat(UStat* aStat)
{
if (IsValid(aStat))
{
int32 index = GetStatIndex(aStat->GetName());
if (index < 0)
{
Stats.Add(aStat);
}
else
{
Stats[index]->AddStat(aStat);
}
}
}
void UStatsComponent::RemoveStat(UStat* aStat)
{
if (IsValid(aStat))
{
uint32 index = GetStatIndex(aStat->GetName());
if (index >= 0)
{
Stats[index]->RemoveStat(aStat);
}
}
}
void UStatsComponent::AddStatistics(UStatsComponent * StatisticsToAdd)
{
if (IsValid(StatisticsToAdd))
{
for (UStat* statToAdd : StatisticsToAdd->GetStats())
{
int32 index = GetStatIndex(statToAdd->GetName(), true);
if (index >= 0)
{
Stats[index]->AddStat(statToAdd);
}
}
}
}
void UStatsComponent::RemoveStatistics(UStatsComponent * StatisticsToAdd)
{
if (IsValid(StatisticsToAdd))
{
for (UStat* statToAdd : StatisticsToAdd->GetStats())
{
int32 index = GetStatIndex(statToAdd->GetName());
if (index >= 0)
{
Stats[index]->RemoveStat(statToAdd);
}
}
}
}
TArray<UStat*> UStatsComponent::GetStats()
{
return Stats;
}
int32 UStatsComponent::GetStatIndex(FName aStatName, bool AIsCreateIfNotFound /*= false*/)
{
for (int i = 0; i < Stats.Num(); ++i)
{
if (IsValid(Stats*) && Stats*->GetName() == aStatName)
return i;
}
if (AIsCreateIfNotFound)
{
UStat* newStat = NewObject<UStat>(this->GetClass(), aStatName);
newStat->SetName(aStatName);
Stats.Add(newStat);
return Stats.Num() - 1;
}
else
return -1;
}
Stat.h
#pragma once
#include "CalculationType.h"
#include "Stat.generated.h"
/**
* Class that holds one stat, it's name, value, modifiers, result bindings...
* Stat consists of base value and modifiers.
* When adding one stat to another, modifiers from the first list will be appended, and bases will be summed
* If you wish to hold just moifier values for adding to other stats (eg. in buffs) just leave the base at 0
*/
UCLASS(Blueprintable, editinlinenew, BlueprintType, ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class TWINSTICK_API UStat : public UObject
{
GENERATED_BODY()
public:
/**
* Default constructor
*/
UStat(const FObjectInitializer& ObjectInitializer);
/**
* Default destructor
*/
~UStat();
/**
* Gets the total value of the stat
*
* @return - value
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
float GetValue();
/**
* Gets the base value of the stat
*
* @return - base value
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
float GetBaseValue();
/**
* Sets the base value of the stat
*
* @param aValue - base value to set
*/
UFUNCTION(BlueprintCallable, Category = "GettersAndSetters")
void SetBaseValue(float aValue);
/**
* Gets the name of the stat
*
* @return - base value
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
FName GetName();
/**
* Sets the name of the stat
*
* @param aName - name to be set
*/
UFUNCTION(BlueprintCallable, Category = "GettersAndSetters")
void SetName(FName aName);
/**
* Adds a new modifier to a stat. Modifier object is owned by
*
* @param aDescription - description of the stat modifyer that could be presented to the user
* @param aType - type of operation modifier applies to the result
* @param aValue - value to be added
* @return returns a const pointer to the created item which can be used to remove the item later
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
class UStatModifier* AddNewStatModifier(FText aDescription, ECalculationType aType, float aValue);
/**
* Adds a modifyer to a stat through a pointer to an existing one
*
* @param aModifier - Pointer to the modifier being created
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
void AddExistingStatModifier(class UStatModifier* aModifier);
///**
//* Removes modifier from a stat by stat modifier handle
//*
//* @param aHandle - handle of the modifier being removed
//* @return - true if modifier was correctly erased
//*/
//UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
//bool RemoveStatModifier(uint32 aHandle);
/**
* Removes modifier from a stat by stat modifier pointer
*
* @param aModifier - pointer to the modifier that should be inserted
* @return - true if modifier was correctly erased
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
bool RemoveStatModifier(class UStatModifier* aModifier);
/**
* Adds a variable to a bound results list. It will be updated on every recalculation
* Warning, never forget to call UnbindResultVariable before destroying anobject referencing this
*
* @param aVariable - reference to the variable being added
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
void BindResultVariable(float& aVariable);
/**
* Removes a variable from a bound results list. It should always be done before destroying an object ownint the variable
*
* @param aVariable - reference to a variable being removed
* @return - true if the variable was correctly removed
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
bool UnbindResultVariable(float& aVariable);
/**
* Removes all modifiers and resets basevalue if aResetBase
*
* @param aResetBase - default: true - if true, base willalso be reset to 0
*/
UFUNCTION(BlueprintCallable, Category = "Reset")
void Reset(bool aResetBase = true);
/**
* Adds another stat values to this one. Bases will be numerically added, modifiers apended to list
*
* @param AStatToAdd - stat to be added to this one
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
void AddStat(class UStat* AStatToAdd);
/**
* Removes another stat values from this one. Bases will be numerically subtracted, modifiers will be removed from the list
*
* @param AStatToAdd - stat to eb added to this one
*/
UFUNCTION(BlueprintCallable, Category = "StatsAddAndRemove")
void RemoveStat(class UStat* AStatToRemove);
/**
* Gets a list of all stats
*
* @return - pointer list to all stats
*/
UFUNCTION(BlueprintPure, Category = "StatsAddAndRemove")
TArray <class UStatModifier*> GetModifiers();
protected:
/**
* Calculates total score and updates all bound variables
*
* @return - score
*/
UFUNCTION(BlueprintPure, Category = "InnerCalculation")
float CalculateScores();
/**
* Name that identifies the stat.
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "StatPropperties")
FName Name;
/**
* Total value of the stat. Should be automatically updated on modifier add or edit
*/
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "StatPropperties")
float Value;
/**
* Counter that determines the next free handle
*/
UPROPERTY()
int32 NextHandle;
/**
* Lost of locally created modifiers and their handles
*/
UPROPERTY()
TMap <int32, class UStatModifier*> ModifierHandles;
/**
* List of external variabls that should be updated to corespond with this stat's value
*/
//UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VariableBinding")
TArray <float*> BoundResultVriables;
/**
* Base modifier
*/
UPROPERTY(EditAnywhere, Instanced, BlueprintReadWrite, Category = "StatBase")
class UStatModifier* BaseModifier;
/**
* List of modifier items that make up the final stat value
*/
UPROPERTY(EditAnywhere, Instanced, BlueprintReadWrite, Category = "Modifier container")
TArray <class UStatModifier*> Modifiers;
//UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "EnvironmentObjectOptions")
};
Stat.cpp
#include "TwinStick.h"
#include "StatModifier.h"
#include "Stat.h"
UStat::UStat(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
NextHandle = 0;
BaseModifier = NewObject<UStatModifier>(this->StaticClass(), FName("BaseValue"));
BaseModifier->SetDescription(NSLOCTEXT("Default", "Base", "Base value"));
BaseModifier->SetCalculationType(ECalculationType::CalculationTypeBase);
BaseModifier->SetValue(10);
}
UStat::~UStat()
{
}
float UStat::GetValue()
{
return Value;
}
float UStat::GetBaseValue()
{
if (IsValid (BaseModifier))
return BaseModifier->GetValue();
else
return 0;
}
void UStat::SetBaseValue(float aValue)
{
if (IsValid (BaseModifier))
BaseModifier->SetValue(aValue);
}
FName UStat::GetName()
{
return Name;
}
void UStat::SetName(FName aName)
{
Name = aName;
}
UStatModifier* UStat::AddNewStatModifier(FText aDescription, ECalculationType aType, float aValue)
{
UStatModifier* createdMod = NewObject <UStatModifier>();
createdMod->SetDescription(aDescription);
createdMod->SetCalculationType(aType);
createdMod->SetValue(aValue);
Modifiers.Add(createdMod);
ModifierHandles[NextHandle] = createdMod;
CalculateScores();
//return NextHandle++; //handles system disabled, might be needed in the future
return createdMod;
}
void UStat::AddExistingStatModifier(UStatModifier* aModifier)
{
if (IsValid(aModifier))
{
Modifiers.Add(aModifier);
ModifierHandles[NextHandle] = aModifier;
CalculateScores();
//return NextHandle++;
}
}
//bool UStat::RemoveStatModifier(uint32 aHandle)
//{
// UStatModifier** modToRemove = ModifierHandles.Find(aHandle);
//
// if (modToRemove)
// {
// Modifiers.Remove(*modToRemove);
// return true;
// }
//
// return false;
//}
bool UStat::RemoveStatModifier(UStatModifier* aModifier)
{
if (Modifiers.Remove(aModifier))
{
CalculateScores();
return true;
}
else
return false;
}
void UStat::BindResultVariable(float& aVariable)
{
BoundResultVriables.Add(&aVariable);
}
bool UStat::UnbindResultVariable(float& aVariable)
{
if (BoundResultVriables.Remove(&aVariable))
return true;
else
return false;
}
void UStat::Reset(bool aResetBase)
{
Modifiers.Empty();
if (aResetBase)
{
SetBaseValue(0);
}
}
void UStat::AddStat(UStat* AStatToAdd)
{
if (IsValid(AStatToAdd))
{
SetBaseValue(GetBaseValue() + AStatToAdd->GetBaseValue());
for (class UStatModifier* mod : AStatToAdd->GetModifiers())
{
AddExistingStatModifier(mod);
}
}
}
void UStat::RemoveStat(UStat * AStatToRemove)
{
if (IsValid(AStatToRemove))
{
SetBaseValue(GetBaseValue() - AStatToRemove->GetBaseValue());
for (class UStatModifier* mod : AStatToRemove->GetModifiers())
{
RemoveStatModifier(mod);
}
}
}
TArray<UStatModifier*> UStat::GetModifiers()
{
return Modifiers;
}
float UStat::CalculateScores()
{
int sum = BaseModifier->GetValue();
int percentage = 0;
int basePercentage = 0;
for (UStatModifier* mod : Modifiers)
{
switch (mod->GetCalculationType())
{
case ECalculationType::CalculationTypeAdd:
sum += mod->GetValue();
break;
case ECalculationType::CalculationTypeAddPercent:
percentage += mod->GetValue();
break;
case ECalculationType::CalculationTypeAddBasePercent:
basePercentage += mod->GetValue();
break;
}
}
sum += BaseModifier->GetValue() * basePercentage;
sum += sum * percentage;
Value = sum;
for (float* boundVal : BoundResultVriables)
{
*boundVal = sum;
}
return sum;
}
StatModifier.h
#pragma once
#include "CalculationType.h"
#include "StatModifier.generated.h"
/**
* Stat modifier class. Adds or reduces values to stats.
*/
UCLASS(Blueprintable, editinlinenew, BlueprintType, ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class TWINSTICK_API UStatModifier : public UObject
{
GENERATED_BODY()
public:
UStatModifier(const FObjectInitializer& ObjectInitializer);
~UStatModifier();
/**
* Gets the modifier value
*
* @return - modifier value
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
float GetValue();
/**
* Sets the modifier value
*
* @param aValue - value to set
*/
UFUNCTION(BlueprintCallable, Category = "GettersAndSetters")
void SetValue (float aValue);
/**
* Gets the modifier description
*
* @return - modifier value
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
FText GetDescription();
/**
* Sets the modifier description
*
* @param aDescription - description to set
*/
UFUNCTION(BlueprintCallable, Category = "GettersAndSetters")
void SetDescription(FText aDescription);
/**
* Gets the modifier calculation type
*
* @return - modifier calculation type
*/
UFUNCTION(BlueprintPure, Category = "GettersAndSetters")
ECalculationType GetCalculationType();
/**
* Sets the modifier calculation type
*
* @param aType - calculation type to set
*/
UFUNCTION(BlueprintCallable, Category = "GettersAndSetters")
void SetCalculationType(ECalculationType aType);
protected:
/**
* modifier description
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ModifierPropperties")
FText Description;
/**
* modifier value
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ModifierPropperties")
float Value;
/**
* modifier calculation type
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ModifierPropperties")
ECalculationType CalculationType;
};
StatModifier.cpp
#include "TwinStick.h"
#include "StatModifier.h"
UStatModifier::UStatModifier(const class FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
Description = NSLOCTEXT("Default", "NoDesc" , "No Description");
Value = 0;
//CalculationType = CalculationTypeUnknown;
}
UStatModifier::~UStatModifier()
{
}
float UStatModifier::GetValue()
{
return Value;
}
void UStatModifier::SetValue(float aValue)
{
Value = aValue;
}
FText UStatModifier::GetDescription()
{
return Description;
}
void UStatModifier::SetDescription(FText aDescription)
{
Description = aDescription;
}
ECalculationType UStatModifier::GetCalculationType()
{
return CalculationType;
}
void UStatModifier::SetCalculationType(ECalculationType aType)
{
CalculationType = aType;
}