#pragma once

#include "TimeOfDayDef.generated.h"

static constexpr int32 DAYS_TO_SECONDS = 86400;
static constexpr int32 HOURS_TO_SECONDS = 3600;
static constexpr int32 MINUTES_TO_SECONDS = 60;

UENUM(BlueprintType)
enum class EWeekday: uint8
{
	None		= 0 UMETA(Hidden),
	Monday		= 1,
	Tuesday		= 2,
	Wednesday	= 3,
	Thursday	= 4,
	Friday		= 5,
	Saturday	= 6,
	Sunday		= 7,
	MAX				UMETA(Hidden)
};

USTRUCT(BlueprintType)
struct FAYE_API FTimeOfDayDef
{
	GENERATED_BODY()
	
	// Adds seconds
	void AddTime(int32 InSeconds);
	int32 GetSeconds() const { return Seconds; }
	int32 GetMinutes() const { return Minutes; }
	int32 GetHours() const { return Hours; }
	int32 GetDays() const { return Days; }
	EWeekday GetWeekday() const { return Weekday; }
	
	float GetTimeOfDayInHours() const;

protected:
	
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Time Of Day")
	int32 Seconds = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Time Of Day")
	int32 Minutes = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Time Of Day")
	int32 Hours = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Time Of Day")
	int32 Days = 0;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Time Of Day")
	EWeekday Weekday = EWeekday::Monday;
};
