示例#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 SetStart()
    {
        PracticeManager.ResetValues();
        PracticeManager.StartPosition = new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y);
        int slot = SaveSlotsManager.CurrentSlotIndex;

        SaveSlotsManager.CurrentSlotIndex = 49;
        SaveSlotsManager.BackupIndex      = -1;
        GameController.Instance.CreateCheckpoint();
        GameController.Instance.SaveGameController.PerformSave();
        SaveSlotsManager.CurrentSlotIndex = slot;
        PracticeManager.WriteFile();
        PracticeManager.ShowMessage("Start set: " + PracticeManager.StartPosition.ToString(), 5f);
    }
示例#3
0
 public static void End()
 {
     PracticeManager.Running     = false;
     PracticeManager.FrameCount += PracticeManager.LagFrames - PracticeManager.ExtraFrames;
     if (PracticeManager.FrameCount < PracticeManager.FrameCountSession)
     {
         PracticeManager.FrameCountSession = PracticeManager.FrameCount;
     }
     if (PracticeManager.FrameCount < PracticeManager.FrameCountAll)
     {
         PracticeManager.FrameCountAll = PracticeManager.FrameCount;
         PracticeManager.WriteFile();
     }
     PracticeManager.ShowFrameInfo();
 }
示例#4
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");
     }
 }