Space Plunder
Loading...
Searching...
No Matches
AInteractableSwitch Class Reference

#include <InteractableSwitch.h>

Inheritance diagram for AInteractableSwitch:
AInteractableActor AActorBase IBaseInterface ISaveLoad ATerminal

Public Member Functions

 AInteractableSwitch ()
 
virtual void ReceiveToggleSwitch (AActor *Caller, const bool bOn) override
 
virtual void ReceiveOnInteract (AActor *Caller, const EInteractionType InteractionType) override
 
- Public Member Functions inherited from AInteractableActor
 AInteractableActor ()
 
virtual void ReceiveStartFocus (AActor *Caller)
 
virtual void ReceiveEndFocus (AActor *Caller)
 
virtual void ReceiveOnEndInteract (AActor *Caller)
 
virtual void ReceiveOnOverlap (AActor *Caller)
 
virtual void ReceiveOnEndOverlap (AActor *Caller)
 
- Public Member Functions inherited from AActorBase
 AActorBase ()
 
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
void SetGravityEnabledEvent (const bool bValue)
 

Public Attributes

bool bSwitchOn = false
 

Protected Member Functions

virtual void BeginPlay () override
 
- Protected Member Functions inherited from AInteractableActor
virtual void Tick (float DeltaTime) override
 
virtual void SetMeshOutline (const bool bValue)
 
- Protected Member Functions inherited from AActorBase
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

TArray< AActor * > ActorsControlledBySwitch
 
- Protected Attributes inherited from AInteractableActor
class UInteractableActorComponent * InteractableActorComponent
 
class UAudioReactionComponent * AudioReactionComponent
 
class UAIPerceptionStimuliSourceComponent * PerceptionStimuliComponent
 
- Protected Attributes inherited from AActorBase
FString DisplayName = "Display Name"
 
bool bDebuggingMode = false
 

Constructor & Destructor Documentation

◆ AInteractableSwitch()

AInteractableSwitch::AInteractableSwitch ( )
explicit
11{
12 PrimaryActorTick.bCanEverTick = false;
14}
class UInteractableActorComponent * InteractableActorComponent
Definition InteractableActor.h:63
Definition BaseData.h:420

Member Function Documentation

◆ BeginPlay()

void AInteractableSwitch::BeginPlay ( )
overrideprotectedvirtual

Reimplemented from AInteractableActor.

Reimplemented in ATerminal.

34{
35 Super::BeginPlay();
36 // if(bSwitchOn)
37 // {
38 // InteractionData.SetDefault(EInteractionType::TurnOff, false);
39 // }
40 // else
41 // {
42 // InteractionData.SetDefault(EInteractionType::TurnOn, false);
43 // }
44}

◆ ReceiveOnInteract()

void AInteractableSwitch::ReceiveOnInteract ( AActor * Caller,
const EInteractionType InteractionType )
overridevirtual

Reimplemented from AInteractableActor.

Reimplemented in ATerminal.

65{
66 Super::ReceiveOnInteract(Caller, InteractionType);
69}
virtual void ReceiveToggleSwitch(AActor *Caller, const bool bOn) override
Definition InteractableSwitch.cpp:16
bool bSwitchOn
Definition InteractableSwitch.h:23

◆ ReceiveToggleSwitch()

void AInteractableSwitch::ReceiveToggleSwitch ( AActor * Caller,
const bool bOn )
overridevirtual

Reimplemented from AInteractableActor.

17{
18 Super::ReceiveToggleSwitch(Caller, bOn);
19 if(!ActorsControlledBySwitch.IsEmpty())
20 {
21 for(const AActor* Actor : ActorsControlledBySwitch)
22 {
24 if(InteractableActor != nullptr)
25 {
26 UE_LOG(LogTemp,Warning,TEXT("ToggleSwitch - Interactable Switch"));
27 InteractableActor->ToggleSwitch(this, bOn);
28 }
29 }
30 }
31}
TArray< AActor * > ActorsControlledBySwitch
Definition InteractableSwitch.h:30
Definition InteractionInterface.h:18
virtual void ToggleSwitch(AActor *Caller, const bool bOn)=0
static IInteractionInterface * GetInteractionFromComponent(const AActor *Actor)
Definition InteractionBPLib.cpp:10

Member Data Documentation

◆ ActorsControlledBySwitch

TArray<AActor*> AInteractableSwitch::ActorsControlledBySwitch
protected

◆ bSwitchOn

bool AInteractableSwitch::bSwitchOn = false

The documentation for this class was generated from the following files: