Agrarsense
AgrarsenseGameModeBase.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include "CoreMinimal.h"
9#include "GameFramework/GameModeBase.h"
10#include "Blueprint/UserWidget.h"
11#include "Templates/SubclassOf.h"
12
14
15#include "AgrarsenseGameModeBase.generated.h"
16
19class UROSCommands;
20class UROSHandler;
21
23class ALidarManager;
24class ASpectator;
25class AWeather;
26class ATagger;
27
28UCLASS()
29class AGRARSENSE_API AAgrarsenseGameModeBase : public AGameModeBase
30{
31
32 GENERATED_BODY()
33
34public:
35
36 AAgrarsenseGameModeBase(const FObjectInitializer& ObjectInitializer);
37
42 UFUNCTION(BlueprintCallable)
43 ALidarManager* GetLidarManager()
44 {
45 return LidarManager;
46 }
47
52 UFUNCTION(BlueprintCallable)
53 UROSHandler* GetROSHandle()
54 {
55 return ROSHandle;
56 }
57
62 UFUNCTION(BlueprintCallable, BlueprintPure)
63 ASimulationLevelManager* GetSimulationLevelManager()
64 {
65 return SimulationLevelManager;
66 }
67
72 UFUNCTION(BlueprintCallable, BlueprintPure)
73 AInstancedRenderer* GetInstancedRenderer()
74 {
75 return InstancedRenderer;
76 }
77
82 UFUNCTION(BlueprintCallable, BlueprintPure)
83 AWeather* GetWeatherActor()
84 {
85 return Weather;
86 }
87
92 UFUNCTION(BlueprintCallable, BlueprintPure)
93 ASpectator* GetSpectator()
94 {
95 return Spectator;
96 }
97
102 UFUNCTION(BlueprintCallable)
103 UROSCommands* GetROSCommands()
104 {
105 return ROSCommands;
106 }
107
112 UPROPERTY(Category = "Agrarsense Game Mode", EditAnywhere)
113 TSubclassOf<ALidarManager> LidarManagerClass;
114
119 UPROPERTY(Category = "Agrarsense Game Mode", EditAnywhere)
120 TSubclassOf<UUserWidget> DeveloperTools;
121
126 UPROPERTY(Category = "Agrarsense Game Mode", EditAnywhere)
127 TSubclassOf<ASimulationLevelManager> SimulationLevelManagerClass;
128
129protected:
130
134 void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
135
139 void BeginPlay() override;
140
144 void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
145
146private:
147
151 void ParseMapChangeLaunchArgument();
152
157 void SpawnNeededActorsInitGame();
158
163 void SpawnNeededActorsBeginPlay();
164
165#if WITH_EDITOR
166 void EditorEndPlayCleanup();
167#endif
168
170 static bool MapChanged;
171
172 UPROPERTY()
173 ALidarManager* LidarManager = nullptr;
174
175 UPROPERTY()
176 UROSHandler* ROSHandle = nullptr;
177
178 UPROPERTY()
179 ASimulationLevelManager* SimulationLevelManager = nullptr;
180
181 UPROPERTY()
182 AInstancedRenderer* InstancedRenderer = nullptr;
183
184 UPROPERTY()
185 UAgrarsenseConsoleCommands* AgrarsenseCommands = nullptr;
186
187 UPROPERTY()
188 AWeather* Weather = nullptr;
189
190 UPROPERTY()
191 UROSCommands* ROSCommands = nullptr;
192
193 UPROPERTY()
194 ASpectator* Spectator = nullptr;
195
196 UPROPERTY()
197 ATagger* Tagger = nullptr;
198
199};
Definition: Tagger.h:29
virtual void BeginPlay() override
Definition: Tagger.cpp:26
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
Definition: Tagger.cpp:54