예제 #1
0
        public static StarRating ReadFromStream(Stream stream)
        {
            var reader = new DatabaseReader(stream);

            var result = new StarRating();

            result.ratings = new Dictionary <long, double>();

            int count = reader.ReadInt();

            for (int i = 0; i < count; i++)
            {
                byte control = reader.ReadByte();
                int  mods    = reader.ReadInt();
                control = reader.ReadByte();
                double rating = reader.ReadDouble();
                result.ratings.Add(mods, rating);
            }

            return(result);
        }
예제 #2
0
        public static BeatmapInformation ReadFromStream(Stream stream)
        {
            var reader = new DatabaseReader(stream);

            return(new BeatmapInformation
            {
                EntrySize = reader.ReadInt(),
                ArtistName = reader.ReadString(),
                ArtistNameUnicode = reader.ReadString(),
                SongTitle = reader.ReadString(),
                SongTitleUnicode = reader.ReadString(),
                CreatorName = reader.ReadString(),
                Difficulty = reader.ReadString(),
                AudioFileName = reader.ReadString(),
                Md5Hash = reader.ReadString(),
                NameOfOsuFile = reader.ReadString(),
                RankedStatus = reader.ReadByte(),
                HitcirclesCount = reader.ReadInt16(),
                SlidersCount = reader.ReadInt16(),
                SpinnersCount = reader.ReadInt16(),
                LastModificationTime = reader.ReadInt64(),
                ApproachRate = reader.ReadSingle(),
                CircleSize = reader.ReadSingle(),
                HpDrain = reader.ReadSingle(),
                OverallDifficulty = reader.ReadSingle(),
                SliderVelocity = reader.ReadDouble(),
                StdStars = StarRating.ReadFromStream(stream),
                TaikoStars = StarRating.ReadFromStream(stream),
                CtbStars = StarRating.ReadFromStream(stream),
                ManiaStars = StarRating.ReadFromStream(stream),
                DrainTime = reader.ReadInt(),
                TotalTime = reader.ReadInt(),
                TimeIdkLol = reader.ReadInt(),
                TimingPoints = TimingPoint.ReadPointsFromStream(stream),
                BeatmapId = reader.ReadInt(),
                BeatmapSetId = reader.ReadInt(),
                ThreadId = reader.ReadInt(),
                GradeAchievedOsu = reader.ReadByte(),
                GradeAchievedTaiko = reader.ReadByte(),
                GradeAchievedCtb = reader.ReadByte(),
                GradeAchievedMania = reader.ReadByte(),
                LocalBeatmapOffset = reader.ReadInt16(),
                StackLeniency = reader.ReadSingle(),
                OsuGameplayMode = reader.ReadByte(),
                SongSource = reader.ReadString(),
                SongTags = reader.ReadString(),
                OnlineOffset = reader.ReadInt16(),
                TitleSongFont = reader.ReadString(),
                IsUnplayed = reader.ReadBoolean(),
                LastPlayTime = reader.ReadInt64(),
                IsOsz2 = reader.ReadBoolean(),
                FolderName = reader.ReadString(),
                LastCheckedTime = reader.ReadInt64(),
                IgnoreHitsounds = reader.ReadBoolean(),
                IgnoreSkin = reader.ReadBoolean(),
                DisableStoryboard = reader.ReadBoolean(),
                DisableVideo = reader.ReadBoolean(),
                VisualOverride = reader.ReadBoolean(),
                LastEditTime = reader.ReadInt(),
                ManiaScrollSpeed = reader.ReadByte()
            });
        }