chore(content): Updates to C# 9 syntax (#373)

This commit is contained in:
Kamron Batman 2020-12-30 12:50:10 -08:00 • committed by GitHub
parent a59fda6a3a
commit 1e2242bb1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 155 additions and 405 deletions

View file

@ -80,27 +80,14 @@ namespace Server
* 6:00 AM -> 9:59 PM : Day
*/
if (hours < 4)
return hours switch
{
return NightLevel;
}
if (hours < 6)
{
return NightLevel + ((hours - 4) * 60 + minutes) * (DayLevel - NightLevel) / 120;
}
if (hours < 22)
{
return DayLevel;
}
if (hours < 24)
{
return DayLevel + ((hours - 22) * 60 + minutes) * (NightLevel - DayLevel) / 120;
}
return NightLevel; // should never be
< 4 => NightLevel,
< 6 => NightLevel + ((hours - 4) * 60 + minutes) * (DayLevel - NightLevel) / 120,
< 22 => DayLevel,
< 24 => DayLevel + ((hours - 22) * 60 + minutes) * (NightLevel - DayLevel) / 120,
_ => NightLevel
};
}
private class LightCycleTimer : Timer