.net 8 syntax/perf changes

This commit is contained in:
Asriel Camora
2024-03-15 01:28:58 -07:00
parent 836e983eb2
commit 94ea1f84de
20 changed files with 117 additions and 136 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
using Craftimizer.Simulator.Actions;
using System.Collections.ObjectModel;
using System.Collections.Frozen;
namespace Craftimizer.Simulator;
@@ -16,14 +16,14 @@ public enum ActionCategory
public static class ActionCategoryUtils
{
private static readonly ReadOnlyDictionary<ActionCategory, ActionType[]> SortedActions;
private static readonly FrozenDictionary<ActionCategory, ActionType[]> SortedActions;
static ActionCategoryUtils()
{
SortedActions = new(
SortedActions =
Enum.GetValues<ActionType>()
.GroupBy(a => a.Category())
.ToDictionary(g => g.Key, g => g.OrderBy(a => a.Level()).ToArray()));
.ToFrozenDictionary(g => g.Key, g => g.OrderBy(a => a.Level()).ToArray());
}
public static IReadOnlyList<ActionType> GetActions(this ActionCategory me)