Files
unrealtest/Source/first/Variant_Shooter/ShooterGameMode.h
T
2026-08-02 22:34:52 +03:00

43 lines
847 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "ShooterGameMode.generated.h"
class UShooterUI;
/**
* Simple GameMode for a first person shooter game
* Manages game UI
* Keeps track of team scores
*/
UCLASS(abstract)
class FIRST_API AShooterGameMode : public AGameModeBase
{
GENERATED_BODY()
protected:
/** Type of UI widget to spawn */
UPROPERTY(EditAnywhere, Category="Shooter")
TSubclassOf<UShooterUI> ShooterUIClass;
/** Pointer to the UI widget */
TObjectPtr<UShooterUI> ShooterUI;
/** Map of scores by team ID */
TMap<uint8, int32> TeamScores;
protected:
/** Gameplay initialization */
virtual void BeginPlay() override;
public:
/** Increases the score for the given team */
void IncrementTeamScore(uint8 TeamByte);
};