Пример #1
0
 public static void SetEnd(int type)
 {
     PracticeManager.ResetValues();
     PracticeManager.EndPosition = new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y);
     PracticeManager.EndType     = type;
     PracticeManager.SetEndReadable();
     PracticeManager.WriteFile();
     PracticeManager.ShowMessage("End set: " + PracticeManager.EndPosition.ToString() + " " + PracticeManager.EndReadable);
 }
Пример #2
0
 public static void ParseSessionFile()
 {
     if (!File.Exists("PracticeSession.txt"))
     {
         PracticeManager.WriteFile();
     }
     try
     {
         string[] lines = File.ReadAllLines("PracticeSession.txt");
         string[] start = lines[0].Split(':')[1].Split(',');
         PracticeManager.StartPosition = new Vector2(float.Parse(start[0]), float.Parse(start[1]));
         string[] end = lines[1].Split(':')[1].Split(',');
         PracticeManager.EndPosition = new Vector2(float.Parse(end[0]), float.Parse(end[1]));
         PracticeManager.EndType     = int.Parse(end[2]);
         PracticeManager.SetEndReadable();
         string[] best = lines[2].Split(':');
         PracticeManager.FrameCountAll = int.Parse(best[1]);
     }
     catch (Exception)
     {
         PracticeManager.ShowMessage("Error parsing session file");
     }
 }