blaster/Source/Blaster/GameMode/BlasterGameMode.h

53 lines
1.3 KiB
C
Raw Normal View History

2022-05-07 15:11:53 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
2022-05-28 14:26:06 +00:00
#include "Blaster/PlayerState/BlasterPlayerState.h"
2022-05-07 15:11:53 +00:00
#include "GameFramework/GameMode.h"
#include "BlasterGameMode.generated.h"
2022-05-10 12:55:02 +00:00
namespace MatchState
{
extern BLASTER_API const FName Cooldown; // Match duration has been reached. Display winner and begin cooldown timer
}
2022-05-07 15:11:53 +00:00
/**
*
*/
UCLASS()
class BLASTER_API ABlasterGameMode : public AGameMode
{
GENERATED_BODY()
2022-05-10 10:15:22 +00:00
public:
ABlasterGameMode();
2022-05-12 13:37:49 +00:00
virtual void Tick(float DeltaTime) override;
2022-05-10 10:15:22 +00:00
virtual void PlayerEliminated(class ABlasterCharacter* EliminatedCharacter, class ABlasterPlayerController* VictimController,
class ABlasterPlayerController* AttackerController);
2022-05-07 18:34:40 +00:00
virtual void RequestRespawn(ACharacter* EliminatedCharacter, AController* EliminatedController);
2022-05-28 14:26:06 +00:00
void PlayerLeftGame(ABlasterPlayerState* PlayerLeaving);
2022-05-10 10:15:22 +00:00
UPROPERTY(EditDefaultsOnly)
float WarmupTime = 10.f;
2022-05-10 12:55:02 +00:00
2022-05-10 12:23:23 +00:00
UPROPERTY(EditDefaultsOnly)
float MatchTime = 120.f;
2022-05-10 12:55:02 +00:00
UPROPERTY(EditDefaultsOnly)
float CooldownTime = 10.f;
2022-05-10 10:15:22 +00:00
float LevelStartingTime = 0.f;
protected:
virtual void BeginPlay() override;
2022-05-10 10:42:09 +00:00
virtual void OnMatchStateSet() override;
2022-05-10 10:15:22 +00:00
private:
2022-05-12 13:37:49 +00:00
float CountdownTime = 0.f;
2022-05-10 13:29:00 +00:00
public:
2022-05-12 13:37:49 +00:00
FORCEINLINE float GetCountdownTime() const { return CountdownTime; }
2022-05-07 15:11:53 +00:00
};