public void SaveData() { string json = Serialaizer.GetInstance().Serialize(instance); var streamWriter = new StreamWriter(matchDataPath); streamWriter.Write(json); streamWriter.Close(); }
public static Serialaizer GetInstance() { if (instance == null) { instance = new Serialaizer(); } return(instance); }
public Match GetMatch() { string json; var streamReader = new StreamReader(matchDataPath); json = streamReader.ReadToEnd(); var match = Serialaizer.GetInstance().Deserialize(json); streamReader.Close(); return(match); }
public void LoadData() { var streamReader = new StreamReader(matchDataPath); string json = streamReader.ReadToEnd(); var data = Serialaizer.GetInstance().DeserializeData(json); streamReader.Close(); if (data != null) { instance = data; } }