This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Source/AgrarianGame/AgrarianGameState.h
T

45 lines
1.3 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.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();
};