Пример #1
0
 public static bool TryGetFieldData(this TypeGeneration typeGen, out MutagenFieldData fieldData)
 {
     if (typeGen.CustomData.TryGetValue(Constants.DataKey, out var dataObj))
     {
         fieldData = (MutagenFieldData)dataObj;
         return(true);
     }
     fieldData = null;
     return(false);
 }
Пример #2
0
 public static string GetVersionIfCheck(MutagenFieldData data, Accessor versionAccessor)
 {
     if (!data.HasVersioning)
     {
         throw new ArgumentException();
     }
     if (data.Versioning.Count <= 2)
     {
         return(string.Join(" && ", data.Versioning.Select(v => $"{versionAccessor} {(v.Action == VersionAction.Add ? ">=" : "<")} {v.Version}")));
     }
     else
     {
         throw new NotImplementedException();
     }
 }