Space Plunder
Loading...
Searching...
No Matches
PatrolPathPoint.h
Go to the documentation of this file.
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
9#include "PatrolPathPoint.generated.h"
10
11UCLASS()
12class AITOOLKIT_API APatrolPathPoint : public AActor, public IPatrolInterface, public IBaseInterface
13{
14 GENERATED_BODY()
15
16public:
18
19 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
20 APatrolPathPoint* GetNextPatrolPoint(bool& bIsBridgeAvailable) const;
21 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
22 APatrolPathPoint* GetPreviousPatrolPoint(bool& bIsBridgeAvailable) const;
23 UFUNCTION(BlueprintCallable, Category="AI Tool Kit")
24 APatrolPathPoint* GetNextBridgePatrolPoint() const;
25
26 //- Patrol interface for AI Tasks //
27 virtual bool GetTimeToWait(float& WaitMin, float& WaitMax) const override;
28 virtual AActor* GetNextPatrolPointActor(bool& bIsBridgeAvailable) const override;
29 virtual AActor* GetNextBridgePatrolPointActor() const override;
30 virtual AActor* GetPreviousPatrolPointActor(bool& bIsBridgeAvailable) const override;
31 virtual float GetRadius() const override {return Radius;};
32 virtual bool GetIsDeadEnd() const override;
33
34 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
35 virtual void SetGravityEnabled(const bool bValue) override{return;};
36 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
37 virtual FString GetObjectDisplayName() const override {return "Patrol Point";};
38 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
39 virtual FInteractionData GetInteractionData() const override{ return InteractionData;};
40 UFUNCTION(BlueprintCallable, Category = "Base Helpers")
41 virtual bool GetIsCharacter() const override{return false;};
42
43 virtual void OnFinishSpawning() override;
44
45protected:
46 virtual void BeginPlay() override;
47
48 virtual void OnConstruction(const FTransform& Transform) override;
49
50 //- Components //
51 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
52 class USceneComponent* SceneRoot;
53 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
54 class UAIPerceptionStimuliSourceComponent* AIStimuliComponent;
55
56// #if WITH_EDITORONLY_DATA
57 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
58 class UBillboardComponent* PreviewIcon;
59 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
60 class UArrowComponent* ArrowComponent;
61 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
62 class UCableComponent* PathCableComponent;
63 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
64 class UCableComponent* BridgePathCableComponent;
65 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="AI Tool Kit")
66 class USphereComponent* SphereRadiusComponent;
67
68// #endif // WITH_EDITOR
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
71
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
73 int32 PathNumber = 0;
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
75 int32 PathStartNumber = 0;
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
77 bool bFinalPoint = false;
78 //- Dead end used to reverse direction back //
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
80 bool bDeadEnd = false;
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
82 bool bUseDirection = false;
83 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
84 FLinearColor PathColor = FLinearColor::Blue;
85 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
86 UMaterial* Material;
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path")
88 int32 PathGroup = 1;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Radius")
90 float Radius = 50.0f;
91
92 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Bridge")
93 bool bCanBridge = false;
94 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Bridge")
95 bool bBridgeEnd = false;
96 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Bridge")
97 int32 BridgeToPathGroup = 0;
98 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Bridge")
99 int32 BridgeToPathNumber = 0;
100 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Bridge")
101 FLinearColor BridgePathColor = FLinearColor::Red;
102
103 //- How long should I wait at this point, if false, will use MIN //
104 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Wait")
105 bool bWaitRandomTime = true;
106 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Wait")
107 float TimeToWaitMin = 0.0f;
108 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Wait")
109 float TimeToWaitMax = 1.0f;
110
111 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Debugging")
112 bool bDebuggingMode = false;
113
114 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Editor")
115 bool bUpdate = false;
116 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AI Tool Kit|Path|Editor")
117 bool bMoveAllNumbersUp1 = false;
118
120 //~ Interaction Data Manipulation ~//
121 virtual bool SetInteractionHidden(const EInteractionType Interaction, const bool bValue) override
122 {return InteractionData.SetInteractionHidden(Interaction, bValue);};
124 {InteractionData.SetOnlyInteractionVisible(Interaction);}
125
126 virtual bool SetInteractionAvailable(const EInteractionType Interaction, const bool bValue) override
127 {return InteractionData.SetInteractionAvailable(Interaction, bValue);}
128
129 virtual bool SetInteractionHold(const EInteractionType Interaction, const bool bValue) override
130 {return InteractionData.SetInteractionHold(Interaction, bValue);}
131
132 virtual TArray<FInteractionType> GetVisibleInteractions() const override
133 {return InteractionData.GetVisibleInteractions();}
134 virtual bool GetInteraction(FInteractionType& Type, const EInteractionType Interaction) const override
135 {return InteractionData.GetInteraction(Type, Interaction);}
136 virtual bool GetDefaultInteraction(FInteractionType& Type) const override
137 {return InteractionData.GetDefaultInteraction(Type);}
138 //~ Interaction Data Manipulation ~//
139
140
141private:
142 void RemoveVisualizers() const;
143 void UpdateVisualizers();
144 void UpdateAllNumbers();
145
146 TArray<APatrolPathPoint*> GetAllPathPoints() const;
147 TArray<APatrolPathPoint*> GetAllPathPointsInGroup(const int32 GroupNumber) const;
148
149
150 UPROPERTY()
151 APatrolPathPoint* NextPathPoint;
152 UPROPERTY()
153 APatrolPathPoint* NextBridgePathPoint;
154 UPROPERTY()
155 APatrolPathPoint* PreviousPathPoint;
156
157};
EInteractionType
Definition BaseData.h:149
EAIStimuliType
Definition BaseData.h:198
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
Definition PatrolPathPoint.h:13
virtual void SetOnlyInteractionVisible(const EInteractionType Interaction) override
Definition PatrolPathPoint.h:123
virtual bool SetInteractionHold(const EInteractionType Interaction, const bool bValue) override
Definition PatrolPathPoint.h:129
virtual bool SetInteractionAvailable(const EInteractionType Interaction, const bool bValue) override
Definition PatrolPathPoint.h:126
virtual TArray< FInteractionType > GetVisibleInteractions() const override
Definition PatrolPathPoint.h:132
virtual float GetRadius() const override
Definition PatrolPathPoint.h:31
virtual bool GetInteraction(FInteractionType &Type, const EInteractionType Interaction) const override
Definition PatrolPathPoint.h:134
virtual bool GetDefaultInteraction(FInteractionType &Type) const override
Definition PatrolPathPoint.h:136
Definition BaseInterface.h:17
An interface class for patrol functionality.
Definition PatrolInterface.h:24
Definition Interaction.Build.cs:6
Definition BaseData.h:420
bool SetInteractionHidden(const EInteractionType Interaction, const bool bValue)
Definition BaseData.h:496
Definition BaseData.h:333