blaster/Source/Blaster/PlayerState/BlasterPlayerState.h

46 lines
996 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blaster/Types/Team.h"
#include "GameFramework/PlayerState.h"
#include "BlasterPlayerState.generated.h"
/**
*
*/
UCLASS()
class BLASTER_API ABlasterPlayerState : public APlayerState
{
GENERATED_BODY()
public:
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
virtual void OnRep_Score() override;
UFUNCTION()
virtual void OnRep_Defeats();
void IncreaseScore(float ScoreAmount);
void IncreaseDefeats(int32 DefeatsAmount);
private:
UPROPERTY()
class ABlasterCharacter* Character;
UPROPERTY()
class ABlasterPlayerController* Controller;
UPROPERTY(ReplicatedUsing = OnRep_Defeats)
int32 Defeats;
UPROPERTY(ReplicatedUsing = OnRep_Team)
ETeam Team = ETeam::ET_NoTeam;
UFUNCTION()
void OnRep_Team();
public:
FORCEINLINE ETeam GetTeam() const { return Team; }
void SetTeam(ETeam TeamToSet);
};