Skip to content

Commit

Permalink
Remove Days struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mertwole committed Aug 24, 2024
1 parent ef93739 commit ac87d07
Showing 1 changed file with 0 additions and 63 deletions.
63 changes: 0 additions & 63 deletions JamGame/Assets/Scripts/Level/GlobalTime/TimeMeasures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,6 @@

namespace Level.GlobalTime
{
[Serializable]
[InlineProperty]
public struct Days
{
[SerializeField]
private float days;
public readonly float Value => days;

public readonly RealTimeSeconds RealTimeSeconds => new(days * Model.DayLength.Value);

public static Days Zero => new(0);

public Days(RealTimeSeconds seconds)
{
days = seconds.Value / Model.DayLength.Value;
}

public Days(float days)
{
this.days = days;
}

public static Days operator +(Days a, Days b)
{
return new Days() { days = a.days + b.days };
}

public static Days operator -(Days a, Days b)
{
return new Days() { days = a.days - b.days };
}

public static Days operator *(Days a, float b)
{
return new Days() { days = a.days * b };
}

public static Days operator *(float a, Days b)
{
return new Days() { days = a * b.days };
}

public static bool operator >(Days a, Days b)
{
return a.days > b.days;
}

public static bool operator <(Days a, Days b)
{
return a.days < b.days;
}

public static bool operator <=(Days a, Days b)
{
return a.days <= b.days;
}

public static bool operator >=(Days a, Days b)
{
return a.days >= b.days;
}
}

[Serializable]
[InlineProperty]
public struct RealTimeSeconds
Expand Down

0 comments on commit ac87d07

Please sign in to comment.