Files
video-record-ue-poc/Source/AudioVideoRecord/Variant_Shooter/ShooterGameMode.h
2026-03-11 11:25:15 +05:30

43 lines
858 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 AUDIOVIDEORECORD_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);
};