44 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
45 void SetStates(TArray<FTrafficLightStage> States);
47 UFUNCTION(Category =
"Traffic Controller", BlueprintPure)
51 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
55 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
56 bool AdvanceTimeAndCycleFinished(
float DeltaTime);
58 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
61 UFUNCTION(Category =
"Traffic Controller", BlueprintPure)
62 const TArray<UTrafficLightComponent *> &GetTrafficLights();
64 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
65 void EmptyTrafficLights();
67 UFUNCTION(Category =
"Traffic Controller", BlueprintPure)
68 const FString &GetControllerId()
const;
70 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
71 void SetControllerId(
const FString &Id);
73 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
74 void AddTrafficLight(UTrafficLightComponent *
TrafficLight);
76 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
77 void RemoveTrafficLight(UTrafficLightComponent *
TrafficLight);
79 void AddCarlaActorTrafficLight(
FCarlaActor* CarlaActor);
81 void RemoveCarlaActorTrafficLight(
FCarlaActor* CarlaActor);
83 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
84 bool IsCycleFinished()
const;
86 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
89 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
90 int GetSequence()
const;
92 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
93 void SetSequence(
int InSequence);
95 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
98 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
99 void SetYellowTime(
float NewTime);
101 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
102 void SetRedTime(
float NewTime);
104 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
105 void SetGreenTime(
float NewTime);
107 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
108 float GetGreenTime()
const;
110 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
111 float GetYellowTime()
const;
113 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
114 float GetRedTime()
const;
116 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
117 float GetElapsedTime()
const;
119 UFUNCTION(Category =
"Traffic Controller", BlueprintCallable)
120 void SetElapsedTime(
float InElapsedTime);
130 return CurrentLightState;
134 CurrentLightState = NewState;
143 UPROPERTY(Category =
"Traffic Controller", EditAnywhere)
144 FString ControllerId = "";
146 UPROPERTY(Category = "Traffic Controller", EditAnywhere)
147 int CurrentState = 0;
150 UPROPERTY(Category = "Traffic Controller", EditAnywhere)
152 {10, ETrafficLightState::Green},
153 { 3, ETrafficLightState::Yellow},
154 { 2, ETrafficLightState::Red}
157 UPROPERTY(Category =
"Traffic Controller", EditAnywhere)
158 TArray<UTrafficLightComponent *> TrafficLights;
162 UPROPERTY(Category = "Traffic Controller", VisibleAnywhere)
166 UPROPERTY(Category = "Traffic Controller", EditAnywhere)
170 float ElapsedTime = 0;