예제 #1
0
        public static string GetImageLocation(this Beatmap beatmap)
        {
            if (beatmap.GetType().IsAssignableFrom(typeof(BeatmapExtension)))
            {
                if (((BeatmapExtension)beatmap).LocalBeatmapMissing)
                {
                    return(string.Empty);
                }
            }
            var    osuFileLocation = beatmap.FullOsuFileLocation();
            string ImageLocation   = string.Empty;

            using (StreamReader file = new StreamReader(osuFileLocation))
            {
                string line;
                while ((line = file.ReadLine()) != null)
                {
                    if (line.ToLower().Contains(".jpg") || line.ToLower().Contains(".png"))
                    {
                        var splited = line.Split(',');
                        ImageLocation = Path.Combine(beatmap.BeatmapDirectory(), splited[2].Trim('"'));
                        if (!File.Exists(ImageLocation))
                        {
                            return(string.Empty);
                        }
                        break;
                    }
                }
            }
            return(ImageLocation);
        }
예제 #2
0
        public static string FullOsuFileLocation(this Beatmap beatmap, string songsDirectory)
        {
            var beatmapDirectory = beatmap.BeatmapDirectory(songsDirectory);

            if (string.IsNullOrEmpty(beatmapDirectory) || string.IsNullOrEmpty(beatmap.OsuFileName))
            {
                return("");
            }
            return(Path.Combine(beatmapDirectory, beatmap.OsuFileName));
        }
예제 #3
0
        public static string FullAudioFileLocation(this Beatmap beatmap)
        {
            var isSubclassed = beatmap.GetType().IsAssignableFrom(typeof(BeatmapExtension));

            if (isSubclassed)
            {
                if (((BeatmapExtension)beatmap).LocalBeatmapMissing)
                {
                    return(string.Empty);
                }
            }

            return(Path.Combine(beatmap.BeatmapDirectory(), beatmap.Mp3Name));
        }
예제 #4
0
 public static string FullOsuFileLocation(this Beatmap beatmap)
 {
     return(Path.Combine(beatmap.BeatmapDirectory(), beatmap.OsuFileName));
 }