public RattlerStoreLoader(RattlerCore core) : base(core) { this.store = core.store; JsonConvert.DefaultSettings = () => new JsonSerializerSettings { Converters = new List <JsonConverter> { new TransportJsonConverter(core), new StationJsonConverter(), new LinkJsonConverter(core), new StoreJsonConverter(core) } }; }
public void loadData() { string path = ABSOLUTHE_PATH + SETTINGS_FILE_NAME; bool exists = File.Exists(path); string rawJson; if (!exists) { File.Create(path).Close(); rawJson = "{}"; File.WriteAllText(path, rawJson); } else { rawJson = File.ReadAllText(path); } RattlerStore loaded = JsonConvert.DeserializeObject <RattlerStore>(rawJson); //demoData(); }