Database Improvements
Brought in all the myriad improvements to the database tools from the Stream Pixels project Added configurable nested entry grouping
This commit is contained in:
parent
526a737a4d
commit
968783bf9c
37 changed files with 865 additions and 580 deletions
16
Assets/Scripts/ServerShared/EnumDictionary.cs
Normal file
16
Assets/Scripts/ServerShared/EnumDictionary.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using MessagePack;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[MessagePackObject, JsonObject(MemberSerialization.OptIn)]
|
||||
public class EnumDictionary<E, T> where E : Enum
|
||||
{
|
||||
[JsonProperty("values"), Key(0)] public T[] Values;
|
||||
|
||||
public EnumDictionary()
|
||||
{
|
||||
Values = new T[Enum.GetNames(typeof(E)).Length];
|
||||
}
|
||||
|
||||
public T this[E key] => Values[Convert.ToInt32(key)];
|
||||
}
|
||||
Loading…
Reference in a new issue