Exemple #1
0
        public static List <PlayData> GetAllPlayData()
        {
            string date = DateTime.Now.ToString("yyyy_MM_dd_");
            //string date = "2020_07_21_";
            string          filepath  = "D:/BeatSaberMod/" + date + "record.csv";
            List <PlayData> scoreData = new List <PlayData>();

            StreamReader file = new StreamReader(filepath, Encoding.UTF8);

            string line = "";

            line = file.ReadLine();
            PlayData data = new PlayData();

            while (line != null)
            {
                Debug.Log(line);
                string[] word = line.Split(","[0]);

                if (word.Length == 1)
                {
                    if (data.GetTotalCnt() > 0)
                    {
                        scoreData.Add(data);
                    }
                    data = new PlayData();
                    data.SetSongName(word[0]);
                }
                else
                {
                    float start     = float.Parse(word[0]);
                    float end       = float.Parse(word[1]);
                    int   goodCnt   = int.Parse(word[2]);
                    int   badCnt    = int.Parse(word[3]);
                    int   missedCnt = int.Parse(word[4]);
                    data.Add(new SectionData(start, end, goodCnt, badCnt, missedCnt));
                }

                line = file.ReadLine();
            }

            scoreData.Add(data);

            return(scoreData);
        }
Exemple #2
0
 static public void UpdateGoodRate(PlayData data)
 {
     lastPlayData = data;
 }
Exemple #3
0
 static public void Update()
 {
     playData.Add(nowPlayData);
     lastPlayData = nowPlayData;
     nowPlayData  = new PlayData();
 }
Exemple #4
0
 // Add/Delete/Read/Write
 public static void Init()
 {
     nowPlayData  = new PlayData();
     lastPlayData = new PlayData();
 }