LEAP Documentation 40220
Documentation for the LEAP project
TeamDeathmatchSpawnPoint.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 "ProjectX.h"
6#include "CoreMinimal.h"
8#include "TeamInterface.h"
10#include "GameFramework/Actor.h"
11#include "TeamDeathmatchSpawnPoint.generated.h"
12
15class APlayerStart;
16
17UCLASS()
18class PROJECTX_API ATeamDeathmatchSpawnPoint : public AActor, public ISpawnTargetInterface, public IReactsToMatchEvents, public ITeamInterface
19{
20 GENERATED_UCLASS_BODY()
21
22public:
23 virtual void BeginPlay() override;
24
25 UFUNCTION(BlueprintPure)
26 virtual FText GetPointName() const { return PointName; }
27
28 virtual bool GetSpawnLocation(AProjectXPlayerState* SpawnInstigator, FTransform& Transform) const override;
29 virtual AActor* GetPlayerStart(class AController* Player) const;
30
31 virtual bool CanSpawnPlayer(const AProjectXPlayerState* SpawnInstigator) const;
32 virtual float GetSpawnScoreForInstigator(const AActor* const QueryInstigator, FVector& TargetLocation, bool bUseDistanceToTargetLocation = false) const override;
33 virtual void CollectPlayerStartList();
34
35 virtual void MatchStarted() override;
36
37 void UpdateSpawnRanges(int32 MaxSpawnRange, int32 MinSpawnRange) { MaxSpawnPointSearchDistance = MaxSpawnRange; MinSpawnPointSearchDistance = MinSpawnRange; }
38
39 virtual int32 GetTeam() const override { return DefaultTeam; }
40
41protected:
42 bool GetPlayerStartList(uint8 Team, TArray<AActor*>& PlayerStartList) const;
43 void SavePlayerStart(AStartPointVolume* StartVolume, TArray<AActor*>& PlayerStartList, APlayerStart* PlayerStart);
44
45 /* The Team That will own this point*/
46 UPROPERTY(EditInstanceOnly, Category = "Assault Point")
47 int32 DefaultTeam = INDEX_NONE;
48
49 //Spawn Volume for players during the mathc
50 UPROPERTY(EditInstanceOnly, Category = "Spawn Point Spawns")
51 TArray<AStartPointVolume*> GamePlayStartPointVolumes;
52
53 //Spawn Volume to use before the match Starts
54 UPROPERTY(EditInstanceOnly, Category = "Spawn Point Spawns")
55 TMap<uint8, AStartPointVolume*> MatchStartPointVolumes;
56
57 TArray<AActor*> GamePlayPlayerStartList;
58
59 TMap<uint8, TArray<AActor*>> MatchStartPlayerStartList;
60
61 //Name of the point to display
62 UPROPERTY(EditInstanceOnly, Category = "SpawnPoint")
63 FText PointName;
64 float MaxSpawnPointSearchDistance = 6000.0f;
65 float MinSpawnPointSearchDistance = 3000.0f;
66
67 bool bMatchStarted = false;
68};
Definition: ProjectXPlayerState.h:238
Definition: StartPointVolume.h:14
Definition: TeamDeathmatchSpawnPoint.h:19
void UpdateSpawnRanges(int32 MaxSpawnRange, int32 MinSpawnRange)
Definition: TeamDeathmatchSpawnPoint.h:37
virtual int32 GetTeam() const override
Definition: TeamDeathmatchSpawnPoint.h:39
Definition: ReactsToMatchEvents.h:16
Definition: SpawnTargetInterface.h:18
Definition: TeamInterface.h:26