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

            streamWriter.Write(json);
            streamWriter.Close();
        }
예제 #2
0
 public static Serialaizer GetInstance()
 {
     if (instance == null)
     {
         instance = new Serialaizer();
     }
     return(instance);
 }
예제 #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);
        }
예제 #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;
            }
        }