You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
absg/Source/SpaceBattler/Private/UpgradeSubsystem.cpp

31 lines
576 B

// Fill out your copyright notice in the Description page of Project Settings.
#include "UpgradeSubsystem.h"
#include "UnitUpgrade.h"
void UUpgradeSubsystem::ApplyUnitUpgrades(AUnit* Unit)
{
for (const auto Upgrade : SelectedUpgrades)
{
UUnitUpgrade* UnitUpgrade = Cast<UUnitUpgrade>(Upgrade.UpgradeData);
if(UnitUpgrade != nullptr)
{
for (const FString Tag : Upgrade.UpgradeData->GetApplicableTags())
{
if(Unit->UnitTags.Contains(Tag))
{
UnitUpgrade->ApplyToUnit(Unit);
}
}
}
}
}
void UUpgradeSubsystem::ApplyGlobalUpgrades()
{
}