Fixed current day of week calculation

This commit is contained in:
Simon Lübeß
2024-04-05 13:54:38 +02:00
parent 81cbff9cab
commit b42ba4a9b1
13 changed files with 1981 additions and 187 deletions

View File

@ -16,15 +16,12 @@ public class TimeManager : MonoBehaviourSingleton<TimeManager>
[SerializeField] private Light _sun;
[SerializeField]
private Weekday _currentWeekday;
private DateTime _startDate;
private DateTime _deadline;
public int DaysLeft => _daysUntilRelease;
public Weekday CurrentWeekday => _currentWeekday;
public DayOfWeek CurrentDayOfWeek => CurrentDate.DayOfWeek;
public TimeSpan TimeOfDay => CurrentDate.TimeOfDay;
@ -48,9 +45,6 @@ public class TimeManager : MonoBehaviourSingleton<TimeManager>
/// </summary>
public bool MissedDeadline => CurrentDate > Deadline;
[SerializeField, ShowOnly]
private string stringgy;
public void Init()
{
_startDate = new DateTime(2024, 4, 2, 12, 0, 0);
@ -60,11 +54,11 @@ public class TimeManager : MonoBehaviourSingleton<TimeManager>
/// <summary>
/// Berechnet die (real life) Sekunden, die die Entwickler bei 100% Effizienz benötigen um das Spiel bei gegebener Schwierigkeit zu entwickeln.
/// </summary>
public double CalculateActualDeveloperTime(Difficulty difficulty)
public double CalculateActualDeveloperTime(Difficulty difficulty, int developerCount)
{
DifficultySettings settings = difficulty.GetSettings();
return _daysUntilRelease * _secondsPerDay / settings.DaysUntilReleaseFactor;
return (_daysUntilRelease * _secondsPerDay * developerCount) / settings.DaysUntilReleaseFactor;
}
void Update()
@ -84,10 +78,7 @@ public class TimeManager : MonoBehaviourSingleton<TimeManager>
{
_totalTime -= 1.0;
_daysUntilRelease--;
_currentWeekday = _currentWeekday.GetNext();
}
stringgy = TimeOfDay.ToString();
}
private void UpdateSun()