public static void setOriginal(this HardpointDataDef 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.ID)) { origs[def.ID] = json; } else { origs.Add(def.ID, json); } }
public static string getOriginal(this HardpointDataDef def) { if (originals.TryGetValue(def.GetType(), out Dictionary <string, string> origs) == false) { return(def.ToJSON()); } if (origs.TryGetValue(def.ID, out string result) == false) { return(def.ToJSON()); } return(result); }