Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "GameFramework/GameStateBase.h"
  7. #include "SGameState.h"
  8. #include "SGameMode.generated.h"
  9.  
  10.  
  11. enum class EWaveState : uint8;
  12.  
  13. /**
  14.  *
  15.  */
  16. UCLASS()
  17. class COOPGAME_API ASGameState : public AGameStateBase
  18. {
  19.     GENERATED_BODY()
  20.  
  21. protected:
  22.  
  23.     FTimerHandle TimerHandle_BotSpawner;
  24.  
  25.     FTimerHandle TimerHandle_NextWaveStart;
  26.  
  27.     // Bots to spawn in current wave
  28.     int32 NrOfBotsToSpawn;
  29.  
  30.     int32 WaveCount;
  31.  
  32.     UPROPERTY(EditDefaultsOnly, Category = "GameMode")
  33.     float TimeBetweenWaves;
  34.  
  35. protected:
  36.  
  37.     // Hook for BP to spawn a single bot
  38.     UFUNCTION(BlueprintImplementableEvent, Category = "GameMode")
  39.     void SpawnNewBot();
  40.  
  41.     void SpawnBotTimerElapsed();
  42.  
  43.     // Start Spawning bots
  44.     void StartWave();
  45.  
  46.     // Stop spawning Bots
  47.     void EndWave();
  48.  
  49.     // Set timer for next bot wave
  50.     void PrepareForNextWave();
  51.  
  52.     void CheckWaveState();
  53.  
  54.     void CheckAnyPlayerAlive();
  55.  
  56.     void GameOver();
  57.  
  58.     void SetWaveState(EWaveState NewState);
  59.  
  60. public:
  61.  
  62.     ASGameMode();
  63.  
  64.     virtual void StartPlay() override;
  65.  
  66.     virtual void Tick(float DeltaSeconds) override;
  67. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement