45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
// 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<FLifetimeProperty>& OutLifetimeProps) const override;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Replicated, Category = "Agrarian|World")
|
|
float WorldHours = 8.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Agrarian|World", meta = (ClampMin = "0.1"))
|
|
float GameHoursPerRealMinute = 0.5f;
|
|
|
|
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();
|
|
};
|