Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ASpawnHub 클래스 참조

#include <SpawnHub.h>

ASpawnHub에 대한 상속 다이어그램 :
Inheritance graph
ASpawnHub에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

void InitializeHub (UStageSubsystem *InStageManager)
 
void RegisterSpawnSystem (UActorComponent *SpawnSystem)
 
void UnregisterSpawnSystem (UActorComponent *SpawnSystem)
 
TArray< ITargetableInterface * > GetAllSpawnedTargetableEntity () const
 
UActorComponent * GetOrCreateSpawnSystem (UPARAM(meta=(MustImplement="/Script/CK_UE.SpawnSystemInterface")) TSubclassOf< UActorComponent > SpawnSystemClass)
 
template<CSpawnSystem TSpawnSystem>
TSpawnSystem * GetSpawnSystem () const
 
template<CSpawnSystem TSpawnSystem>
TSpawnSystem * GetOrCreateSpawnSystem ()
 
template<CSpawnSystem TSpawnSystem>
TArray< TSpawnSystem * > GetRegisteredSpawnSystems () const
 

Private 속성

TWeakObjectPtr< UStageSubsystem > StageManager
 
TArray< TWeakObjectPtr< UActorComponent > > RegisteredSpawnSystems
 

상세한 설명

현재 스테이지(레벨)에 존재하는 모든 스폰된 객체들을 관리하는 글로벌 허브. 각 SpawnSystemComponent를 소유하고, 스폰된 객체 조회의 단일 진입점 역할을 한다.

멤버 함수 문서화

◆ GetAllSpawnedTargetableEntity()

TArray< ITargetableInterface * > ASpawnHub::GetAllSpawnedTargetableEntity ( ) const
78{
79 TArray<ITargetableInterface*> Result;
80
81 for (const TWeakObjectPtr<UActorComponent>& Weak : RegisteredSpawnSystems)
82 {
83 if (const ISpawnSystemInterface* SpawnSystem = Cast<ISpawnSystemInterface>(Weak.Get()))
84 {
85 SpawnSystem->CollectSpawnedTargetables(Result);
86 }
87 }
88
89 return Result;
90}
TArray< TWeakObjectPtr< UActorComponent > > RegisteredSpawnSystems
Definition SpawnHub.h:58
Definition SpawnSystemInterface.h:25

다음을 참조함 : RegisteredSpawnSystems.

◆ GetOrCreateSpawnSystem() [1/2]

template<CSpawnSystem TSpawnSystem>
TSpawnSystem * ASpawnHub::GetOrCreateSpawnSystem ( )
78{
79 TSpawnSystem* SpawnSystem = FindComponentByClass<TSpawnSystem>();
80
81 if (SpawnSystem)
82 {
83 RegisterSpawnSystem(SpawnSystem);
84 return SpawnSystem;
85 }
86
87 SpawnSystem = NewObject<TSpawnSystem>(this, TSpawnSystem::StaticClass());
88 SpawnSystem->RegisterComponent();
89 SpawnSystem->Initialize(StageManager.Get());
90 RegisterSpawnSystem(SpawnSystem);
91 return SpawnSystem;
92}
void RegisterSpawnSystem(UActorComponent *SpawnSystem)
Definition SpawnHub.cpp:24
TWeakObjectPtr< UStageSubsystem > StageManager
Definition SpawnHub.h:55

다음을 참조함 : RegisterSpawnSystem(), StageManager.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ GetOrCreateSpawnSystem() [2/2]

UActorComponent * ASpawnHub::GetOrCreateSpawnSystem ( UPARAM(meta=(MustImplement="/Script/CK_UE.SpawnSystemInterface")) TSubclassOf< UActorComponent >  SpawnSystemClass)

다음에 의해서 참조됨 : UStageSubsystem::GetOrCreateSpawnSystem(), AEncounterField::StartEncounter().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetRegisteredSpawnSystems()

template<CSpawnSystem TSpawnSystem>
TArray< TSpawnSystem * > ASpawnHub::GetRegisteredSpawnSystems ( ) const
97{
98 TArray<TSpawnSystem*> Result;
99
100 for (const TWeakObjectPtr<UActorComponent>& Weak : RegisteredSpawnSystems)
101 {
102 if (TSpawnSystem* SpawnSystem = Cast<TSpawnSystem>(Weak.Get()))
103 {
104 Result.Add(SpawnSystem);
105 }
106 }
107
108 return Result;
109}

다음을 참조함 : RegisteredSpawnSystems.

◆ GetSpawnSystem()

template<CSpawnSystem TSpawnSystem>
TSpawnSystem * ASpawnHub::GetSpawnSystem ( ) const
64{
65 TSpawnSystem* SpawnSystem = FindComponentByClass<TSpawnSystem>();
66
67 if (SpawnSystem == nullptr)
68 {
69 LOG_ERROR(LogCK, "%s가 존재하지 않습니다. ", NAMEOF(TSpawnSystem));
70 }
71
72 return SpawnSystem;
73}
#define LOG_ERROR(Category, Format,...)
Definition CK_UE.h:41
#define NAMEOF(Type)
Definition CK_UE.h:31

다음을 참조함 : LOG_ERROR, NAMEOF.

◆ InitializeHub()

void ASpawnHub::InitializeHub ( UStageSubsystem *  InStageManager)
14{
15 StageManager = InStageManager;
16
18 GetOrCreateSpawnSystem<UEnemySpawnDirectorSystemComponent>();
19 GetOrCreateSpawnSystem<UProjectileSpawnSystemComponent>();
20 GetOrCreateSpawnSystem<UInteractableSpawnSystemComponent>();
21}

다음을 참조함 : RegisteredSpawnSystems, StageManager.

◆ RegisterSpawnSystem()

void ASpawnHub::RegisterSpawnSystem ( UActorComponent *  SpawnSystem)
25{
26 if (Cast<ISpawnSystemInterface>(SpawnSystem) == nullptr)
27 {
28 return;
29 }
30
31 RegisteredSpawnSystems.AddUnique(SpawnSystem);
32}

다음을 참조함 : RegisteredSpawnSystems.

다음에 의해서 참조됨 : GetOrCreateSpawnSystem().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UnregisterSpawnSystem()

void ASpawnHub::UnregisterSpawnSystem ( UActorComponent *  SpawnSystem)
36{
37 auto IsUnregisterTarget = [SpawnSystem](const TWeakObjectPtr<UActorComponent>& Weak)
38 {
39 return Weak.Get() == SpawnSystem || Weak.IsValid() == false;
40 };
41
42 RegisteredSpawnSystems.RemoveAll(IsUnregisterTarget);
43}

다음을 참조함 : RegisteredSpawnSystems.

멤버 데이터 문서화

◆ RegisteredSpawnSystems

TArray<TWeakObjectPtr<UActorComponent> > ASpawnHub::RegisteredSpawnSystems
private

◆ StageManager

TWeakObjectPtr<UStageSubsystem> ASpawnHub::StageManager
private

다음에 의해서 참조됨 : GetOrCreateSpawnSystem(), InitializeHub().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: