LEAP Documentation 40220
Documentation for the LEAP project
ProjectXGameStateVIP.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"
7#include "ProjectXGameStateVIP.generated.h"
8
9
10
11USTRUCT(BlueprintType)
12struct FVIP
13{
14 GENERATED_USTRUCT_BODY()
15
16 FVIP() {}
17 FVIP(TWeakObjectPtr<AProjectXPlayerState> NewVIPPlayerState, uint8 NewVIPID) {
18 VIPPlayerState = NewVIPPlayerState;
19 VIPID = NewVIPID;
20 PreviousVIP = NULL;
21 }
22
23 bool operator==(const FVIP& VIP)
24 {
25 if (VIPPlayerState == VIP.VIPPlayerState && VIPID == VIP.VIPID)
26 {
27 return true;
28 }
29 else return false;
30 }
31
32 UPROPERTY(BlueprintReadOnly)
33 TWeakObjectPtr<AProjectXPlayerState> VIPPlayerState = NULL;
34 UPROPERTY(BlueprintReadOnly)
35 TWeakObjectPtr<AProjectXPlayerState>PreviousVIP = NULL;
36 UPROPERTY(BlueprintReadOnly)
37 uint8 VIPID = -1;
38};
39
40USTRUCT(BlueprintType)
42{
43 GENERATED_USTRUCT_BODY()
45
46 FTeamVIP(uint8 NewTeam)
47 {
48 Team = NewTeam;
49 VIPS = TArray<FVIP>();
50 }
51
52 UPROPERTY(BlueprintReadOnly)
53 TArray<FVIP> VIPS = TArray<FVIP>();
54 UPROPERTY(BlueprintReadOnly)
55 uint8 Team = -1;
56};
57
58DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FVIPSEventSignature,const TArray<FTeamVIP>&, VIPsList);
60
61UCLASS()
62class PROJECTX_API AProjectXGameStateVIP : public AProjectXGameState
63{
64 GENERATED_BODY()
65
66public:
67 void AddNewVip(AProjectXPlayerState* PlayerState,uint8 VIPID,uint8 Team);
68
69 UFUNCTION()
70 void VIPDefeated(AProjectXPlayerState* PlayerState);
71 uint8 GetVIPID(AProjectXPlayerState* PlayerState);
72
73 UFUNCTION(BlueprintCallable)
74 bool GetVIPByPlayerState(AProjectXPlayerState* PlayerState, FVIP& FoundVIP) const;
75 UFUNCTION(BlueprintCallable)
76 void GetVIPS(TArray<FTeamVIP>& FoundVIPs) const { FoundVIPs = VIPS; }
77 UFUNCTION(BlueprintCallable)
78 bool GetVIPsByTeam(uint8 Team,TArray<FVIP>& FoundPlayerStates) const;
79 UFUNCTION(BlueprintCallable,BlueprintPure)
80 int32 GetNumberOfVIPS() const;
81
82 bool GetVIP(uint8 Team, uint8 ID, FVIP& FoundVIP);
83
84 virtual void HandleMatchWarmupEnded() override;
85
86 UFUNCTION()
87 void OnRep_VIPInfo();
88
89 UPROPERTY(BlueprintAssignable)
90 FVIPSEventSignature OnVipsUpdatedEvent;
91
92 UPROPERTY(BlueprintAssignable)
93 FVIPEventSignature VIPEvent;
94
95protected:
96 UPROPERTY(ReplicatedUsing = OnRep_VIPInfo)
97 TArray<FTeamVIP> VIPS;
98
99 FString MatchStartVIP = "VO_MatchStart_VIP";
100};
EVIPEvent
Definition: ProjectXGameModeVIP.h:11
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FVIPSEventSignature, const TArray< FTeamVIP > &, VIPsList)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FVIPEventSignature, const AProjectXPlayerState *, VIP, EVIPEvent, Event)
Definition: ProjectXGameState.h:158
Definition: ProjectXGameStateVIP.h:63
Definition: ProjectXPlayerState.h:238
Definition: ProjectXGameStateVIP.h:42
FTeamVIP(uint8 NewTeam)
Definition: ProjectXGameStateVIP.h:46
Definition: ProjectXGameStateVIP.h:13
FVIP(TWeakObjectPtr< AProjectXPlayerState > NewVIPPlayerState, uint8 NewVIPID)
Definition: ProjectXGameStateVIP.h:17
bool operator==(const FVIP &VIP)
Definition: ProjectXGameStateVIP.h:23