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.

31 lines
581 B

9 months ago
// Copyright Zelle Games
#include "RosterSubsystem.h"
const URosterEntry* URosterSubsystem::GetEnemy(int32 Section, int32 ScoreAvailable)
9 months ago
{
int32 CB = 0;
while(CB < 10000)
{
CB++;
const URosterEntry* RosterEntry = EnemyRoster[Section][FMath::RandRange(0, EnemyRoster[Section].Num() -1)];
9 months ago
if(RosterEntry->DifficultyRating <= ScoreAvailable)
{
return RosterEntry;
}
}
return nullptr;
}
void URosterSubsystem::AddToRoster(TArray<URosterEntry*> RosterEntries)
{
EnemyRoster.Add(RosterEntries);
}
void URosterSubsystem::ClearRoster()
{
EnemyRoster.Empty();
}