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

@ -865,24 +865,9 @@ namespace Server.Misc
{
var vMax = max - 30;
var vStr = str - 10;
var vDex = dex - 10;
var vInt = intel - 10;
if (vStr < 0)
{
vStr = 0;
}
if (vDex < 0)
{
vDex = 0;
}
if (vInt < 0)
{
vInt = 0;
}
var vStr = Math.Max(str - 10, 0);
var vDex = Math.Max(dex - 10, 0);
var vInt = Math.Max(intel - 10, 0);
var total = vStr + vDex + vInt;

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

View file

@ -841,7 +841,7 @@ namespace Server
}
else if (item is BaseInstrument instr)
{
var slayer = SlayerName.None;
SlayerName slayer;
if (Core.AOS)
{

View file

@ -329,16 +329,7 @@ namespace Server.Misc
}
else
{
density = 150 - m_Stage * 5;
if (density < 10)
{
density = 10;
}
else if (density > 70)
{
density = 70;
}
density = Math.Clamp(150 - m_Stage * 5, 10, 70);
}
if (density == 0)