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

#include <InteractionChannel.h>

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

Public 멤버 함수

void Initialize (ACharacterBase *InRequester)
 
void RegisterInteractable (UInteractabilityComponent *Interactable)
 
void UnregisterInteractable (UInteractabilityComponent *Interactable)
 
void Close ()
 
FORCEINLINE ACharacterBaseGetRequester () const
 
FORCEINLINE bool IsEmpty () const
 
FORCEINLINE bool IsClosed () const
 

정적 Public 멤버 함수

static UInteractionChannelCreateChannel (ACharacterBase *Caller, UInteractabilityComponent *InteractabilityCompo)
 

Public 속성

FOnInteractionDelegate OnInteractableRegistered
 
FOnInteractionDelegate OnInteractableUnregistered
 
FOnInteractionChannelEmpty OnChannelEmpty
 

Private 멤버 함수

void RemoveInvalidInteractableActors ()
 

Private 속성

bool bIsClosed = false
 
TWeakObjectPtr< ACharacterBaseRequester
 
TArray< TWeakObjectPtr< UInteractabilityComponent > > RegisteredInteractables
 

멤버 함수 문서화

◆ Close()

void UInteractionChannel::Close ( )
86{
87 if (bIsClosed)
88 {
89 return;
90 }
91
92 bIsClosed = true;
93
94 for (const TWeakObjectPtr<UInteractabilityComponent>& Interactable : RegisteredInteractables)
95 {
96 if (Interactable.IsValid() && Interactable->GetActiveChannel() == this)
97 {
98 Interactable->UnregisterFromChannel();
99 }
100 }
101
105 OnChannelEmpty.Clear();
106 Requester.Reset();
107}
TWeakObjectPtr< ACharacterBase > Requester
Definition InteractionChannel.h:65
bool bIsClosed
Definition InteractionChannel.h:63
FOnInteractionChannelEmpty OnChannelEmpty
Definition InteractionChannel.h:60
FOnInteractionDelegate OnInteractableRegistered
Definition InteractionChannel.h:54
TArray< TWeakObjectPtr< UInteractabilityComponent > > RegisteredInteractables
Definition InteractionChannel.h:66
FOnInteractionDelegate OnInteractableUnregistered
Definition InteractionChannel.h:57
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ CreateChannel()

UInteractionChannel * UInteractionChannel::CreateChannel ( ACharacterBase Caller,
UInteractabilityComponent *  InteractabilityCompo 
)
static
13{
14 UInteractionChannel* Channel = NewObject<UInteractionChannel>(Caller);
15 check(Channel);
16
17 AActor* ThisActor = Cast<AActor>(InteractabilityCompo->GetOwner());
18 checkf(ThisActor, TEXT("%s의 Owner를 %s로 형변환할 수 없습니다. "), NAMEOF(UInteractabilityComponent), NAMEOF(AActor));
19
20 Channel->Initialize(Caller);
21
22 FScriptDelegate OnRegisteredDelegate;
23 FScriptDelegate OnUnregisteredDelegate;
24
25 OnRegisteredDelegate.BindUFunction(ThisActor, GET_FUNCTION_NAME_CHECKED(IInteractableInterface, OnBeginInteraction));
26 OnUnregisteredDelegate.BindUFunction(ThisActor, GET_FUNCTION_NAME_CHECKED(IInteractableInterface, OnEndInteraction));
27
28 Channel->OnInteractableRegistered.Add(OnRegisteredDelegate);
29 Channel->OnInteractableUnregistered.Add(OnUnregisteredDelegate);
30
31 InteractabilityCompo->RegisterToChannel(Channel);
32 return Channel;
33}
#define NAMEOF(Type)
Definition CK_UE.h:30
Definition InteractableInterface.h:23
Definition InteractionChannel.h:21
void Initialize(ACharacterBase *InRequester)
Definition InteractionChannel.cpp:36
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetRequester()

FORCEINLINE ACharacterBase * UInteractionChannel::GetRequester ( ) const
inline
38 {
39 return Requester.Get();
40 }

◆ Initialize()

void UInteractionChannel::Initialize ( ACharacterBase InRequester)
37{
38 Requester = InRequester;
39}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ IsClosed()

FORCEINLINE bool UInteractionChannel::IsClosed ( ) const
inline
48 {
49 return bIsClosed;
50 }

◆ IsEmpty()

FORCEINLINE bool UInteractionChannel::IsEmpty ( ) const
inline
43 {
44 return RegisteredInteractables.IsEmpty();
45 }
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ RegisterInteractable()

void UInteractionChannel::RegisterInteractable ( UInteractabilityComponent *  Interactable)
43{
44 if (bIsClosed || Interactable == nullptr)
45 {
46 return;
47 }
48
50
51 if (RegisteredInteractables.Contains(Interactable))
52 {
53 return;
54 }
55
56 RegisteredInteractables.Add(Interactable);
57 OnInteractableRegistered.Broadcast(Requester.Get());
58}
void RemoveInvalidInteractableActors()
Definition InteractionChannel.cpp:110
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ RemoveInvalidInteractableActors()

void UInteractionChannel::RemoveInvalidInteractableActors ( )
private
111{
112 RegisteredInteractables.RemoveAll([](const TWeakObjectPtr<UInteractabilityComponent>& Interactable)
113 {
114 return Interactable.IsValid() == false;
115 });
116}
이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ UnregisterInteractable()

void UInteractionChannel::UnregisterInteractable ( UInteractabilityComponent *  Interactable)
62{
63 if (!ensureAlwaysMsgf(Interactable, TEXT("%s is nullptr"), NAMEOF(Interactable)))
64 {
65 return;
66 }
67
68 if (RegisteredInteractables.Remove(Interactable) == 0)
69 {
71 return;
72 }
73
76
77 if (IsEmpty())
78 {
79 OnChannelEmpty.Broadcast();
80 Close();
81 }
82}
void Close()
Definition InteractionChannel.cpp:85
FORCEINLINE bool IsEmpty() const
Definition InteractionChannel.h:42
이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ bIsClosed

bool UInteractionChannel::bIsClosed = false
private

◆ OnChannelEmpty

FOnInteractionChannelEmpty UInteractionChannel::OnChannelEmpty

◆ OnInteractableRegistered

FOnInteractionDelegate UInteractionChannel::OnInteractableRegistered

◆ OnInteractableUnregistered

FOnInteractionDelegate UInteractionChannel::OnInteractableUnregistered

◆ RegisteredInteractables

TArray<TWeakObjectPtr<UInteractabilityComponent> > UInteractionChannel::RegisteredInteractables
private

◆ Requester

TWeakObjectPtr<ACharacterBase> UInteractionChannel::Requester
private

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