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

#include <AIControllerCore.h>

Inheritance diagram for AAIControllerCore:
AAIControllerBase IControllerInterface ISaveLoad

Public Member Functions

 AAIControllerCore ()
 
virtual void Tick (float DeltaTime) override
 
virtual ETeamAttitude::Type GetTeamAttitudeTowards (const AActor &Other) const override
 
- Public Member Functions inherited from AAIControllerBase
 AAIControllerBase ()
 
virtual FVector GetPawnLocation () const override
 
virtual void GetControllerViewPoint (FVector &out_Location, FRotator &out_Rotation) const override
 
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
virtual void SetGenericTeamId (const FGenericTeamId &NewTeamID) override
 
virtual FGenericTeamId GetGenericTeamId () const override
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual void OnPossess (APawn *InPawn) override
 
- Protected Member Functions inherited from AAIControllerBase
int32 GetTeamID () const
 
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

EFactionType Faction = EFactionType::Alliance
 
- Protected Attributes inherited from AAIControllerBase
FGenericTeamId TeamID
 
TObjectPtr< UBehaviorTree > Behaviour = nullptr
 
bool bDebuggingMode = false
 

Constructor & Destructor Documentation

◆ AAIControllerCore()

AAIControllerCore::AAIControllerCore ( )
9{
10 PrimaryActorTick.bCanEverTick = true;
11}

Member Function Documentation

◆ BeginPlay()

void AAIControllerCore::BeginPlay ( )
overrideprotectedvirtual

Reimplemented from AAIControllerBase.

15{
16 Super::BeginPlay();
17
18}

◆ GetTeamAttitudeTowards()

ETeamAttitude::Type AAIControllerCore::GetTeamAttitudeTowards ( const AActor & Other) const
overridevirtual

Reimplemented from AAIControllerBase.

31{
32 if(const APawn* OtherPawn = Cast<APawn>(&Other))
33 {
34 if(const IGenericTeamAgentInterface* TeamAgent = Cast<IGenericTeamAgentInterface>(OtherPawn->GetController()))
35 {
36 const FGenericTeamId OtherTeamID = TeamAgent->GetGenericTeamId();
37 const EFactionType OtherPawnFaction = UAIBPLib::GetFactionFromTeamID(OtherTeamID);
38 bool bSuccess = false;
39 //- @TODO this should store on Begin, then not have to use the BPLib each time to update //
40 //- Game State should update any Characters of Relationship Changes
41
42 const FFactionRelationship Relationship = UAIBPLib::GetFactionRelationship(this, Faction, OtherPawnFaction, bSuccess);
43 if(bSuccess)
44 {
45 switch (Relationship.RelationshipStatus)
46 {
49 return ETeamAttitude::Friendly;
53 return ETeamAttitude::Neutral;
56 return ETeamAttitude::Hostile;
57 }
58 }
59 }
60 }
61 return ETeamAttitude::Neutral;
62}
EFactionType
Definition AIDataTypes.h:103
EFactionType Faction
Definition AIControllerCore.h:42
static EFactionType GetFactionFromTeamID(const uint8 TeamID)
Definition AIBPLib.cpp:120
static FFactionRelationship GetFactionRelationship(const UObject *WorldContextObject, const EFactionType Faction, const EFactionType TargetFaction, bool &bSuccess, UDataTable *DataTable=nullptr)
Definition AIBPLib.cpp:339
Definition AIDataTypes.h:279
ERelationshipStatus RelationshipStatus
Definition AIDataTypes.h:284

◆ OnPossess()

void AAIControllerCore::OnPossess ( APawn * InPawn)
overrideprotectedvirtual

Reimplemented from AAIControllerBase.

21{
22 Super::OnPossess(InPawn);
23}

◆ Tick()

void AAIControllerCore::Tick ( float DeltaTime)
overridevirtual
26{
27 Super::Tick(DeltaTime);
28}

Member Data Documentation

◆ Faction

EFactionType AAIControllerCore::Faction = EFactionType::Alliance
protected

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