Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Dec 14, 2024
1 parent 35ac969 commit 11811f8
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions JL.Core/Statistics/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,36 +122,19 @@ public static void IncrementStat(StatType type, long amount = 1)

public static void ResetStats(StatsMode statsMode)
{
switch (statsMode)
Stats stats = statsMode switch
{
case StatsMode.Lifetime:
LifetimeStats.Characters = 0;
LifetimeStats.Lines = 0;
LifetimeStats.Time = TimeSpan.Zero;
LifetimeStats.CardsMined = 0;
LifetimeStats.TimesPlayedAudio = 0;
LifetimeStats.Imoutos = 0;
break;

case StatsMode.Profile:
ProfileLifetimeStats.Characters = 0;
ProfileLifetimeStats.Lines = 0;
ProfileLifetimeStats.Time = TimeSpan.Zero;
ProfileLifetimeStats.CardsMined = 0;
ProfileLifetimeStats.TimesPlayedAudio = 0;
ProfileLifetimeStats.Imoutos = 0;
break;

case StatsMode.Session:
SessionStats.Characters = 0;
SessionStats.Lines = 0;
SessionStats.Time = TimeSpan.Zero;
SessionStats.CardsMined = 0;
SessionStats.TimesPlayedAudio = 0;
SessionStats.Imoutos = 0;
break;
default:
throw new ArgumentOutOfRangeException(nameof(statsMode), statsMode, "Invalid StatsMode");
}
StatsMode.Lifetime => LifetimeStats,
StatsMode.Profile => ProfileLifetimeStats,
StatsMode.Session => SessionStats,
_ => throw new ArgumentOutOfRangeException(nameof(statsMode), statsMode, "Invalid StatsMode")
};

stats.Characters = 0;
stats.Lines = 0;
stats.Time = TimeSpan.Zero;
stats.CardsMined = 0;
stats.TimesPlayedAudio = 0;
stats.Imoutos = 0;
}
}

0 comments on commit 11811f8

Please sign in to comment.