mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Refactor database to reuse existing types
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class Beatmap
|
||||
{
|
||||
[PrimaryKey]
|
||||
public int ID { get; set; }
|
||||
[NotNull, Indexed]
|
||||
public int BeatmapSetID { get; set; }
|
||||
[Indexed]
|
||||
public int BeatmapMetadataID { get; set; }
|
||||
public float DrainRate { get; set; }
|
||||
public float CircleSize { get; set; }
|
||||
public float OverallDifficulty { get; set; }
|
||||
public float ApproachRate { get; set; }
|
||||
public float SliderMultiplier { get; set; }
|
||||
public float SliderTickRate { get; set; }
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using osu.Framework.OS;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using SQLite;
|
||||
@ -52,7 +53,7 @@ namespace osu.Game.Database
|
||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||
var beatmap = decoder.Decode(stream);
|
||||
maps.Add(new Beatmap
|
||||
{
|
||||
{
|
||||
BeatmapID = beatmap.BeatmapID,
|
||||
BeatmapSetID = metadata.BeatmapSetID,
|
||||
// TODO: Import more things
|
||||
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using osu.Game.GameModes.Play;
|
||||
using SQLite;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class BeatmapMetadata
|
||||
{
|
||||
[PrimaryKey]
|
||||
public int ID { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string TitleUnicode { get; set; }
|
||||
public string Artist { get; set; }
|
||||
public string ArtistUnicode { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string Source { get; set; }
|
||||
public string Tags { get; set; }
|
||||
public PlayMode Mode { get; set; }
|
||||
public int PreviewTime { get; set; }
|
||||
public string AudioFile { get; set; }
|
||||
public string BackgroundFile { get; set; }
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class BeatmapSet
|
||||
{
|
||||
[PrimaryKey]
|
||||
public int BeatmapSetID { get; set; }
|
||||
[NotNull, Indexed]
|
||||
public int BeatmapMetadataID { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user