// Copyright Pacificao. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "GameFramework/GameStateBase.h" #include "AgrarianTypes.h" #include "AgrarianGameState.generated.h" UCLASS() class AAgrarianGameState : public AGameStateBase { GENERATED_BODY() public: AAgrarianGameState(); virtual void Tick(float DeltaSeconds) override; virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; UPROPERTY(EditAnywhere, BlueprintReadOnly, Replicated, Category = "Agrarian|World") float WorldHours = 8.0f; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|World", meta = (ClampMin = "0.001")) float GameHoursPerRealMinute = 1.0f / 60.0f; UPROPERTY(EditAnywhere, BlueprintReadOnly, ReplicatedUsing = OnRep_Weather, Category = "Agrarian|World") EAgrarianWeatherType Weather = EAgrarianWeatherType::Clear; UPROPERTY(EditAnywhere, BlueprintReadOnly, Replicated, Category = "Agrarian|World") float AmbientTemperatureC = 12.0f; UFUNCTION(BlueprintCallable, Category = "Agrarian|World") bool IsNight() const; UFUNCTION(BlueprintCallable, Category = "Agrarian|World") void SetWeather(EAgrarianWeatherType NewWeather); protected: UFUNCTION() void OnRep_Weather(); void UpdateAmbientTemperature(); };