LEAP Documentation 40220
Documentation for the LEAP project
SoftBoundaryVolume.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
7#include "TeamInterface.h"
10#include "SoftBoundaryVolume.generated.h"
11
12class UAfflictionOverlapComponent;
13
14DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnTeamOwnerChangedSignature, int32, NewTeam);
15DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnVolumeActiveStateChangedSignature, bool, bNewState);
16
17UCLASS(BlueprintType, Blueprintable)
18class PROJECTX_API ASoftBoundaryVolume : public AActor, public ITeamInterface, public IReactsToMatchEvents, public ITrackableInterface
19{
20 GENERATED_UCLASS_BODY()
21
22public:
23 //Gets the team this boundary is set to
24 virtual int32 GetTeam() const override { return TeamOwner; }
25 //Sets the new team for this soft boundary
26 virtual int32 SetTeam(int32 NewTeam) override;
27
28 virtual float GetRadarIconSize() const { return GetSoftBoundaryRadius(); }
29 virtual TSoftObjectPtr<UTexture2D> GetRadarIcon() const override { return RadarIcon; }
30 virtual float GetRadarIconOpacity() const override { return RadarIconOpacity; }
31 virtual float GetRadarIconEnemyOpacity() const override { return RadarIconEnemyOpacity; }
32 virtual bool GetRadarIconCompensantesRotation() const override { return true; }
33
34 //Toggles this boundary volume's capabilities On/Off
35 UFUNCTION(BlueprintCallable, Category = "Soft Boundary|Events")
36 virtual void ToggleVolume(bool bToggle);
37 //Gets if this boundary volume is active or not
38 UFUNCTION(BlueprintCallable, Category = "Soft Boundary|State")
39 virtual bool GetVolumeActiveState() const { return bIsBoundaryActive; }
40 UFUNCTION(BlueprintCallable, Category = "Soft Boundary")
41 float GetSoftBoundaryRadius() const;
42
43 UPROPERTY(BlueprintAssignable, Category = "Soft Boundary|Events")
44 FOnTeamOwnerChangedSignature OnBoundaryTeamOwnerChanged;
45 UPROPERTY(BlueprintAssignable, Category = "Soft Boundary|Events")
46 FOnVolumeActiveStateChangedSignature OnBoundaryActiveStateChanged;
47
48protected:
49 virtual void BeginPlay() override;
50 virtual void MatchEnded() override;
51 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
52
53 UFUNCTION()
54 void OnActivationToggledForActor(AActor* TargetActor, bool bIsActivated);
55
56 UFUNCTION()
57 void OnRep_TeamOwner();
58 UFUNCTION()
59 void OnRep_IsBoundaryActive();
60
61protected:
62 //The starting team owner of this volume, this can be changed dynammicaly through UAfflictionOverlapComponent::SetTeam;
63 UPROPERTY(EditAnywhere, ReplicatedUsing = OnRep_TeamOwner, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
64 int32 TeamOwner = INDEX_NONE;
65 //The starting team owner of this volume, this can be changed dynammicaly through UAfflictionOverlapComponent::SetTeam;
66 UPROPERTY(EditAnywhere, ReplicatedUsing = OnRep_TeamOwner, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
67 bool bDeactivateOnTeamNone = true;
68 // If true, this soft boundary volume is active and running its logic based on overlap events
69 UPROPERTY(EditAnywhere, ReplicatedUsing = OnRep_IsBoundaryActive, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
70 bool bIsBoundaryActive = true;
71 //The base Affliction Overlap Component used by this volume
72 UPROPERTY(EditAnywhere, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
73 UAfflictionOverlapComponent* BoundaryZone = nullptr;
74
75 /* The icon used for this boundary on the radar*/
76 UPROPERTY(EditDefaultsOnly, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
77 TSoftObjectPtr<UTexture2D> RadarIcon = nullptr;
78 /* Use this to make the radar icon semi-transparent */
79 UPROPERTY(EditDefaultsOnly, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
80 float RadarIconOpacity = 0.3f;
81 /* Use this to make the radar icon semi-transparent when enemy*/
82 UPROPERTY(EditDefaultsOnly, Category = "Soft Boundary", meta = (AllowPrivateAccess = true))
83 float RadarIconEnemyOpacity = .9f;
84
85};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnTeamOwnerChangedSignature, int32, NewTeam)
Definition: SoftBoundaryVolume.h:19
virtual float GetRadarIconSize() const
Definition: SoftBoundaryVolume.h:28
virtual float GetRadarIconOpacity() const override
Definition: SoftBoundaryVolume.h:30
virtual bool GetRadarIconCompensantesRotation() const override
Definition: SoftBoundaryVolume.h:32
virtual float GetRadarIconEnemyOpacity() const override
Definition: SoftBoundaryVolume.h:31
virtual TSoftObjectPtr< UTexture2D > GetRadarIcon() const override
Definition: SoftBoundaryVolume.h:29
virtual int32 GetTeam() const override
Definition: SoftBoundaryVolume.h:24
Definition: ReactsToMatchEvents.h:16
Definition: TeamInterface.h:26
Definition: TrackableInterface.h:22