using osu.Game.IO.Legacy;

namespace Vibrio.Models.OsuDb {
    public class BeatmapInfo {
        public string ArtistName;
        public string ArtistNameUnicode;
        public string SongTitle;
        public string SongTitleUnicode;
        public string CreatorName;
        public string DifficultyName;
        public string AudioFileName;
        public string BeatmapHash;
        public string OsuFileName;
        public byte RankedStatus;
        public short HitcircleCount;
        public short SliderCount;
        public short SpinnerCount;
        public long LastModificationTime;
        public float ApproachRate;
        public float CircleSize;
        public float HpDrain;
        public float OverallDifficulty;
        public double SliderVelocity;
        public IntDoublePair[] StandardStarRatingInfo;
        public IntDoublePair[] TaikoStarRatingInfo;
        public IntDoublePair[] CtbStarRatingInfo;
        public IntDoublePair[] ManiaStarRatingInfo;
        public int DrainTime;
        public int TotalTime;
        public int AudioPreviewTime;
        public TimingPoint[] TimingPoints;
        public int DifficultyId;
        public int BeatmapId;
        public int ThreadId;
        public byte StandardGrade;
        public byte TaikoGrade;
        public byte CtbGrade;
        public byte ManiaGrade;
        public short LocalOffset;
        public float StackLeniency;
        public byte GameplayMode;
        public string SongSource;
        public string SongTags;
        public short OnlineOffset;
        public string TitleFont;
        public bool IsUnplayed;
        public long LastPlayedTime;
        public bool IsOsz2;
        public string FolderName;
        public long LastCheckedOnlineTime;
        public bool IgnoreBeatmapSound;
        public bool IgnoreBeatmapSkin;
        public bool DisableStoryboard;
        public bool DisableVideo;
        public bool VisualOverride;
        public int LastModificationTime2;
        public byte ManiaScrollSpeed;

        public BeatmapInfo(SerializationReader reader) {
            ArtistName = reader.ReadString();
            ArtistNameUnicode = reader.ReadString();
            SongTitle = reader.ReadString();
            SongTitleUnicode = reader.ReadString();
            CreatorName = reader.ReadString();
            DifficultyName = reader.ReadString();
            AudioFileName = reader.ReadString();
            BeatmapHash = reader.ReadString();
            OsuFileName = reader.ReadString();
            RankedStatus = reader.ReadByte();
            HitcircleCount = reader.ReadInt16();
            SliderCount = reader.ReadInt16();
            SpinnerCount = reader.ReadInt16();
            LastModificationTime = reader.ReadInt64();
            ApproachRate = reader.ReadInt32();
            CircleSize = reader.ReadInt32();
            HpDrain = reader.ReadInt32();
            OverallDifficulty = reader.ReadInt32();
            SliderVelocity = reader.ReadDouble();
            StandardStarRatingInfo = reader.ReadStarRatingInfo();
            TaikoStarRatingInfo = reader.ReadStarRatingInfo();
            CtbStarRatingInfo = reader.ReadStarRatingInfo();
            ManiaStarRatingInfo = reader.ReadStarRatingInfo();
            DrainTime = reader.ReadInt32();
            TotalTime = reader.ReadInt32();
            AudioPreviewTime = reader.ReadInt32();
            TimingPoints = reader.ReadTimingPoints();
            DifficultyId = reader.ReadInt32();
            BeatmapId = reader.ReadInt32();
            ThreadId = reader.ReadInt32();
            StandardGrade = reader.ReadByte();
            TaikoGrade = reader.ReadByte();
            CtbGrade = reader.ReadByte();
            ManiaGrade = reader.ReadByte();
            LocalOffset = reader.ReadInt16();
            StackLeniency = reader.ReadInt32();
            GameplayMode = reader.ReadByte();
            SongSource = reader.ReadString();
            SongTags = reader.ReadString();
            OnlineOffset = reader.ReadInt16();
            TitleFont = reader.ReadString();
            IsUnplayed = reader.ReadBoolean();
            LastPlayedTime = reader.ReadInt64();
            IsOsz2 = reader.ReadBoolean();
            FolderName = reader.ReadString();
            LastCheckedOnlineTime = reader.ReadInt64();
            IgnoreBeatmapSound = reader.ReadBoolean();
            IgnoreBeatmapSkin = reader.ReadBoolean();
            DisableStoryboard = reader.ReadBoolean();
            DisableVideo = reader.ReadBoolean();
            VisualOverride = reader.ReadBoolean();
            LastModificationTime2 = reader.ReadInt32();
            ManiaScrollSpeed = reader.ReadByte();
        }
    }
}
