blaster/Source/Blaster/GameState/BlasterGameState.h

48 lines
964 B
C
Raw Permalink Normal View History

2022-05-17 22:41:31 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameState.h"
#include "BlasterGameState.generated.h"
/**
*
*/
UCLASS()
class BLASTER_API ABlasterGameState : public AGameState
{
GENERATED_BODY()
public:
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
void UpdateTopScore(class ABlasterPlayerState* ScoringPlayer);
UPROPERTY(Replicated)
2022-05-30 13:48:46 +00:00
TArray<ABlasterPlayerState*> TopScoringPlayers;
// Teams
2022-05-30 19:18:34 +00:00
void RedTeamScores();
void BlueTeamScores();
2022-05-30 13:48:46 +00:00
TArray<ABlasterPlayerState*> RedTeam;
TArray<ABlasterPlayerState*> BlueTeam;
UPROPERTY(ReplicatedUsing = OnRep_RedTeamScore)
float RedTeamScore = 0.f;
UPROPERTY(ReplicatedUsing = OnRep_BlueTeamScore)
float BlueTeamScore = 0.f;
UFUNCTION()
void OnRep_RedTeamScore();
UFUNCTION()
void OnRep_BlueTeamScore();
2022-05-17 22:41:31 +00:00
private:
float TopScore = 0.f;
};