Ejemplo n.º 1
0
 public static void setOriginal(this TurretDef def, string json)
 {
     if (originals.TryGetValue(def.GetType(), out Dictionary <string, string> origs) == false)
     {
         origs = new Dictionary <string, string>();
         originals.Add(def.GetType(), origs);
     }
     if (origs.ContainsKey(def.Description.Id))
     {
         origs[def.Description.Id] = json;
     }
     else
     {
         origs.Add(def.Description.Id, json);
     }
 }
Ejemplo n.º 2
0
 public static string getOriginal(this TurretDef def)
 {
     if (originals.TryGetValue(def.GetType(), out Dictionary <string, string> origs) == false)
     {
         return(def.ToJSON());
     }
     if (origs.TryGetValue(def.Description.Id, out string result) == false)
     {
         return(def.ToJSON());
     }
     return(result);
 }