diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 1421086054..0af085dce0 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -11,7 +11,7 @@ namespace osu.Desktop public static class Program { [STAThread] - public static void Main() + public static void Main(string[] args) { BasicGameHost host = Host.GetSuitableHost(@"osu"); host.Add(new OsuGame()); diff --git a/osu.Game/Beatmaps/GameMode.cs b/osu.Game/Beatmaps/GameMode.cs new file mode 100644 index 0000000000..a555d3b320 --- /dev/null +++ b/osu.Game/Beatmaps/GameMode.cs @@ -0,0 +1,11 @@ +using System; +namespace osu.Game.Beatmaps +{ + public enum GameMode + { + Osu = 0, + Taiko = 1, + CatchTheBeat = 2, + OsuMania = 3, + } +} \ No newline at end of file diff --git a/osu.Game/Database/Beatmap.cs b/osu.Game/Database/Beatmap.cs new file mode 100644 index 0000000000..e60d455a16 --- /dev/null +++ b/osu.Game/Database/Beatmap.cs @@ -0,0 +1,21 @@ +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; } + } +} \ No newline at end of file diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs new file mode 100644 index 0000000000..2c318c5997 --- /dev/null +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -0,0 +1,21 @@ +using System; +using SQLite; + +namespace osu.Game.Database +{ + public class BeatmapDatabase + { + private static SQLiteConnection Connection { get; set; } + + public BeatmapDatabase() + { + if (Connection == null) + { + Connection = new SQLiteConnection("beatmap.db"); + Connection.CreateTable(); + Connection.CreateTable(); + Connection.CreateTable(); + } + } + } +} \ No newline at end of file diff --git a/osu.Game/Database/BeatmapMetadata.cs b/osu.Game/Database/BeatmapMetadata.cs new file mode 100644 index 0000000000..b29ed0f593 --- /dev/null +++ b/osu.Game/Database/BeatmapMetadata.cs @@ -0,0 +1,23 @@ +using System; +using osu.Game.Beatmaps; +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 GameMode Mode { get; set; } + public int PreviewTime { get; set; } + public string AudioFile { get; set; } + public string BackgroundFile { get; set; } + } +} \ No newline at end of file diff --git a/osu.Game/Database/BeatmapSet.cs b/osu.Game/Database/BeatmapSet.cs new file mode 100644 index 0000000000..fd0e161d93 --- /dev/null +++ b/osu.Game/Database/BeatmapSet.cs @@ -0,0 +1,14 @@ +using System; +using SQLite; + +namespace osu.Game.Database +{ + public class BeatmapSet + { + [PrimaryKey] + public int BeatmapSetID { get; set; } + [NotNull, Indexed] + public int MetadataID { get; set; } + } +} + diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 229b306d14..98a5c254bb 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Textures; using osu.Framework.IO.Stores; using osu.Game.Configuration; +using osu.Game.Database; using osu.Game.Graphics.Cursor; using osu.Game.Graphics.Processing; using osu.Game.Online.API; @@ -16,6 +17,7 @@ namespace osu.Game public class OsuGameBase : BaseGame { internal OsuConfigManager Config = new OsuConfigManager(); + internal BeatmapDatabase Beatmaps = new BeatmapDatabase(); protected override string MainResourceFile => @"osu.Game.Resources.dll"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index bdb852c33f..b5e4ea1adf 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -43,6 +43,18 @@ + + ..\packages\SQLitePCLRaw.core.1.0.1\lib\net45\SQLitePCLRaw.core.dll + + + ..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.0.1\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll + + + ..\packages\SQLitePCLRaw.bundle_green.1.0.1\lib\net45\SQLitePCLRaw.batteries_green.dll + + + ..\packages\sqlite-net-pcl.1.2.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLite-net.dll + @@ -148,6 +160,11 @@ + + + + + @@ -166,6 +183,9 @@ + + + - \ No newline at end of file + + + + diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 8c9d8076cf..d40da68750 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -1,9 +1,16 @@ - - - - - - \ No newline at end of file + + + + + + + + + + + + +