Exemple #1
0
        public void SaveData()
        {
            string json         = Serialaizer.GetInstance().Serialize(instance);
            var    streamWriter = new StreamWriter(matchDataPath);

            streamWriter.Write(json);
            streamWriter.Close();
        }
Exemple #2
0
 public static Serialaizer GetInstance()
 {
     if (instance == null)
     {
         instance = new Serialaizer();
     }
     return(instance);
 }
Exemple #3
0
        public Match GetMatch()
        {
            string json;
            var    streamReader = new StreamReader(matchDataPath);

            json = streamReader.ReadToEnd();
            var match = Serialaizer.GetInstance().Deserialize(json);

            streamReader.Close();

            return(match);
        }
Exemple #4
0
        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;
            }
        }