Esempio n. 1
0
    public static void ExportDifficultyCalculation(bool extras)
    {
        var songIDs = GameObject.FindObjectOfType <SongSelect>().GetSongIDs(extras);

        using (System.IO.StreamWriter file =
                   new System.IO.StreamWriter(Application.dataPath + "/../" + "difficultyCalculatorOutput.txt"))
        {
            file.WriteLine("Song Name, Difficulty, Difficulty Rating, BPM, Author");
            for (int i = 0; i < songIDs.Count; i++)
            {
                var songData = SongList.I.GetSong(songIDs[i]);
                var calc     = new DifficultyCalculator(songData);
                if (calc.expert != null)
                {
                    file.WriteLine($"{SongBrowser.RemoveFormatting(songData.artist).Replace(",", "")} - {SongBrowser.RemoveFormatting(songData.title).Replace(",", "")}," +
                                   "Expert," +
                                   $"{calc.expert.difficultyRating.ToString("n2")}," +
                                   $"{songData.tempos[0].tempo.ToString("n2")}," +
                                   $"{songData.author}");
                }
                if (calc.advanced != null)
                {
                    file.WriteLine($"{SongBrowser.RemoveFormatting(songData.artist).Replace(",", "")} - {SongBrowser.RemoveFormatting(songData.title).Replace(",", "")}," +
                                   "Advanced," +
                                   $"{calc.advanced.difficultyRating.ToString("n2")}," +
                                   $"{songData.tempos[0].tempo.ToString("n2")}," +
                                   $"{songData.author}");
                }
                if (calc.standard != null)
                {
                    file.WriteLine($"{SongBrowser.RemoveFormatting(songData.artist).Replace(",", "")} - {SongBrowser.RemoveFormatting(songData.title).Replace(",", "")}," +
                                   "Standard," +
                                   $"{calc.standard.difficultyRating.ToString("n2")}," +
                                   $"{songData.tempos[0].tempo.ToString("n2")}," +
                                   $"{songData.author}");
                }
                if (calc.beginner != null)
                {
                    file.WriteLine($"{SongBrowser.RemoveFormatting(songData.artist).Replace(",", "")} - {SongBrowser.RemoveFormatting(songData.title).Replace(",", "")}," +
                                   "Beginner," +
                                   $"{calc.beginner.difficultyRating.ToString("n2")}," +
                                   $"{songData.tempos[0].tempo.ToString("n2")}," +
                                   $"{songData.author}");
                }
            }
        }
    }
Esempio n. 2
0
    public static string CreateDisplayString(List <CalculatedScoreEntry> scores)
    {
        string output = $"{((int)ScoreHistory.audicaScore).ToString()}AP <size=60%><color=#999>(Audica Points)</color></size><size=60%>\nTop scores:<size=40%>";

        for (int i = 0; i < 25; i++)
        {
            if (!(i >= scores.Count))
            {
                var song = SongList.I.GetSong(scores[i].songID);
                if (song != null)
                {
                    output += $"\n<color=green>{scores[i].audicaPointsWeighted.ToString("n2")}AP</color>" +
                              " | " +
                              $"{SongBrowser.RemoveFormatting(song.artist)} - {SongBrowser.RemoveFormatting(song.title)} " +
                              $"<color=#999>({scores[i].maxScorePercent.ToString("P")})</color>";
                }
            }
        }
        return(output);
    }