Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
InteractionChannel.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CK_UE.h"
6#include "UObject/Object.h"
7#include "InteractionChannel.generated.h"
8
9
10class ACharacterBase;
11class UInteractabilityComponent;
12
13
14DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnInteractionDelegate, const AActor*, Requester);
15
16DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnInteractionChannelEmpty);
17
18
19UCLASS(Transient)
20class CK_UE_API UInteractionChannel : public UObject
21{
22 GENERATED_BODY()
23
24public:
25 static UInteractionChannel* CreateChannel(ACharacterBase* Caller, UInteractabilityComponent* InteractabilityCompo);
26
27public:
28 void Initialize(ACharacterBase* InRequester);
29 void RegisterInteractable(UInteractabilityComponent* Interactable);
30 void UnregisterInteractable(UInteractabilityComponent* Interactable);
31 void Close();
32
33private:
34 void RemoveInvalidInteractableActors();
35
36public:
37 FORCEINLINE ACharacterBase* GetRequester() const
38 {
39 return Requester.Get();
40 }
41
42 FORCEINLINE bool IsEmpty() const
43 {
44 return RegisteredInteractables.IsEmpty();
45 }
46
47 FORCEINLINE bool IsClosed() const
48 {
49 return bIsClosed;
50 }
51
52public:
53 UPROPERTY(BlueprintAssignable, Category = "Interaction|Channel")
54 FOnInteractionDelegate OnInteractableRegistered;
55
56 UPROPERTY(BlueprintAssignable, Category = "Interaction|Channel")
57 FOnInteractionDelegate OnInteractableUnregistered;
58
59 UPROPERTY(BlueprintAssignable, Category = "Interaction|Channel")
60 FOnInteractionChannelEmpty OnChannelEmpty;
61
62private:
63 bool bIsClosed = false;
64
65 TWeakObjectPtr<ACharacterBase> Requester;
66 TArray<TWeakObjectPtr<UInteractabilityComponent>> RegisteredInteractables;
67};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnInteractionDelegate, const AActor *, Requester)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnInteractionChannelEmpty)
Definition CharacterBase.h:21
Definition InteractionChannel.h:21
FORCEINLINE bool IsClosed() const
Definition InteractionChannel.h:47
FORCEINLINE ACharacterBase * GetRequester() const
Definition InteractionChannel.h:37
FORCEINLINE bool IsEmpty() const
Definition InteractionChannel.h:42