Agrarsense
SimulationLevelManager.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/Actor.h"
13#include "SimulationLevelManager.generated.h"
14
15class AVehicle;
16
19
23UCLASS()
24class AGRARSENSE_API ASimulationLevelManager : public AActor
25{
26 GENERATED_BODY()
27
28public:
30
32 UFUNCTION(BlueprintPure)
33 ESimulationState GetSimulationState() const { return SimulationState; }
34
35 UFUNCTION(BlueprintCallable)
36 void SetSimulationState(ESimulationState newState);
37
39 UFUNCTION(BlueprintPure)
40 ESimulationPhase GetSimulationPhase() const { return SimulationPhase; }
41
42 UFUNCTION(BlueprintCallable)
43 void SetSimulationPhase(ESimulationPhase newPhase);
44
48 UPROPERTY(BlueprintAssignable)
49 FSimulationStateChanged OnSimulationStateChanged;
50
54 UPROPERTY(BlueprintAssignable)
55 FSimulationPhaseChanged OnSimulationPhaseChanged;
56
61 UFUNCTION(BlueprintCallable)
62 USensorsManagerComponent* GetSensorsManager() const
63 {
64 return SensorsManager;
65 }
66
71 UFUNCTION(BlueprintCallable, BlueprintPure)
72 AVehicle* GetManuallyControlledVehicle()
73 {
74 return ManuallyControlledVehicle;
75 }
76
82 UFUNCTION(BlueprintCallable)
83 bool TakeManualControlOfVehicle(AVehicle* Vehicle);
84
88 UFUNCTION(BlueprintCallable)
89 void CeaseManualControlOfVehicle();
90
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Teleport Locations")
92 TArray<FLevelTeleportLocation> TeleportLocations;
93
94protected:
95 virtual void BeginPlay() override;
96
97 /*
98 * Manages sensors attached to the world
99 */
100 UPROPERTY(Category = Vehicle, VisibleAnywhere, BlueprintReadOnly)
101 TObjectPtr<USensorsManagerComponent> SensorsManager;
102
103
104
105private:
107 ESimulationState SimulationState;
108
110 ESimulationPhase SimulationPhase;
111
113 UPROPERTY()
114 TObjectPtr<AVehicle> ManuallyControlledVehicle;
115};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSimulationStateChanged, ESimulationState, state)
ESimulationPhase
ESimulationState
virtual void BeginPlay() override
Definition: Vehicle.cpp:26
USensorsManagerComponent * GetSensorsManager() const
Definition: Vehicle.h:141
TObjectPtr< USensorsManagerComponent > SensorsManager
Definition: Vehicle.h:257