Merge remote-tracking branch 'upstream/master' into replay

# Conflicts:
#	osu.Desktop.VisualTests/Tests/TestCasePlayer.cs
#	osu.Desktop/OsuGameDesktop.cs
#	osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs
#	osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs
#	osu.Game/Database/BeatmapDatabase.cs
#	osu.Game/Graphics/Cursor/OsuCursorContainer.cs
#	osu.Game/IPC/BeatmapImporter.cs
#	osu.Game/Modes/Mod.cs
#	osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs
#	osu.Game/Modes/UI/Playfield.cs
#	osu.Game/Screens/Play/Player.cs
#	osu.Game/Screens/Play/PlayerInputManager.cs
This commit is contained in:
Dean Herbert
2017-03-07 13:50:08 +09:00
171 changed files with 513 additions and 462 deletions

View File

@ -21,11 +21,12 @@ namespace osu.Game.Database
{
public class BeatmapDatabase
{
private SQLiteConnection connection { get; set; }
private SQLiteConnection connection { get; }
private Storage storage;
public event Action<BeatmapSetInfo> BeatmapSetAdded;
public event Action<BeatmapSetInfo> BeatmapSetRemoved;
// ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
private BeatmapIPCChannel ipc;
public BeatmapDatabase(Storage storage, IIpcHost importHost = null)
@ -74,7 +75,7 @@ namespace osu.Game.Database
}
catch (Exception e)
{
Logger.Error(e, $@"Could not delete beatmap {b.ToString()}");
Logger.Error(e, $@"Could not delete beatmap {b}");
}
}
@ -150,7 +151,7 @@ namespace osu.Game.Database
catch (Exception e)
{
e = e.InnerException ?? e;
Logger.Error(e, $@"Could not import beatmap set");
Logger.Error(e, @"Could not import beatmap set");
}
// Batch commit with multiple sets to database
@ -325,8 +326,7 @@ namespace osu.Game.Database
return item;
}
readonly Type[] validTypes = new[]
{
private readonly Type[] validTypes = {
typeof(BeatmapSetInfo),
typeof(BeatmapInfo),
typeof(BeatmapMetadata),
@ -336,7 +336,7 @@ namespace osu.Game.Database
public void Update<T>(T record, bool cascade = true) where T : class
{
if (validTypes.All(t => t != typeof(T)))
throw new ArgumentException(nameof(T), "Must be a type managed by BeatmapDatabase");
throw new ArgumentException("Must be a type managed by BeatmapDatabase", nameof(T));
if (cascade)
connection.UpdateWithChildren(record);
else