5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
11#include "SpawnHub.generated.h"
18concept CSpawnSystem = std::derived_from<T, UActorComponent> && std::derived_from<T, ISpawnSystemInterface>;
32 void RegisterSpawnSystem(UActorComponent* SpawnSystem);
33 void UnregisterSpawnSystem(UActorComponent* SpawnSystem);
35 TArray<ITargetableInterface*> GetAllSpawnedTargetableEntity()
const;
39 UFUNCTION(BlueprintCallable, Category=
"SpawnHub", meta=(DeterminesOutputType=
"SpawnSystemClass"))
40 UActorComponent* GetOrCreateSpawnSystem(UPARAM(meta=(MustImplement="/Script/
CK_UE.SpawnSystemInterface")) TSubclassOf<UActorComponent> SpawnSystemClass);
44 TSpawnSystem* GetSpawnSystem() const;
47 TSpawnSystem* GetOrCreateSpawnSystem();
51 TArray<TSpawnSystem*> GetRegisteredSpawnSystems() const;
58 TArray<TWeakObjectPtr<UActorComponent>> RegisteredSpawnSystems;
65 TSpawnSystem* SpawnSystem = FindComponentByClass<TSpawnSystem>();
67 if (SpawnSystem ==
nullptr)
76template <CSpawnSystem TSpawnSystem>
79 TSpawnSystem* SpawnSystem = FindComponentByClass<TSpawnSystem>();
87 SpawnSystem = NewObject<TSpawnSystem>(
this, TSpawnSystem::StaticClass());
88 SpawnSystem->RegisterComponent();
95template <CSpawnSystem TSpawnSystem>
98 TArray<TSpawnSystem*> Result;
102 if (TSpawnSystem* SpawnSystem = Cast<TSpawnSystem>(Weak.Get()))
104 Result.Add(SpawnSystem);
#define LOG_ERROR(Category, Format,...)
Definition CK_UE.h:40
#define NAMEOF(Type)
Definition CK_UE.h:30
TArray< TWeakObjectPtr< UActorComponent > > RegisteredSpawnSystems
Definition SpawnHub.h:58
TWeakObjectPtr< UStageManagementSubsystem > StageManager
Definition SpawnHub.h:55
TSpawnSystem * GetOrCreateSpawnSystem()
Definition SpawnHub.h:77
void RegisterSpawnSystem(UActorComponent *SpawnSystem)
Definition SpawnHub.cpp:24
TArray< TSpawnSystem * > GetRegisteredSpawnSystems() const
Definition SpawnHub.h:96
Definition CK_UE.Build.cs:6
Definition TargetableInterface.h:20
Definition EnemySpawnDirectorSystemComponent.h:75
Definition StageManagementSubsystem.h:147