Esempio n. 1
0
 public void Write <TEnum>(
     MutagenWriter writer,
     IReadOnlyDictionary <TEnum, TValue> items,
     UtilityTranslation.BinarySubWriteDelegate <TValue> transl)
     where TEnum : struct, Enum, IConvertible
 {
     foreach (var e in EnumBinaryTranslation <TEnum> .Values)
     {
         if (items.TryGetValue(e, out var val))
         {
             transl(writer, val);
         }
         else
         {
             transl(writer, default !);
Esempio n. 2
0
 public void Write <TEnum>(
     MutagenWriter writer,
     IReadOnlyDictionary <TEnum, TValue> items,
     UtilityTranslation.BinarySubWriteDelegate <TValue> transl)
     where TEnum : struct, Enum, IConvertible
 {
     for (int i = 0; i < EnumBinaryTranslation <TEnum> .EnumSize; i++)
     {
         if (items.TryGetValue(EnumExt.GetNth <TEnum>(i), out var val))
         {
             transl(writer, val);
         }
         else
         {
             transl(writer, default !);