Fix most warnings.

This commit is contained in:
Dean Herbert
2017-03-07 10:59:19 +09:00
parent 9106c45858
commit 0cad5d7d41
168 changed files with 504 additions and 473 deletions

View File

@ -20,11 +20,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 BeatmapImporter ipc;
public BeatmapDatabase(Storage storage, GameHost importHost = null)
@ -73,7 +74,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}");
}
}
@ -149,7 +150,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
@ -318,8 +319,7 @@ namespace osu.Game.Database
return item;
}
readonly Type[] validTypes = new[]
{
private readonly Type[] validTypes = {
typeof(BeatmapSetInfo),
typeof(BeatmapInfo),
typeof(BeatmapMetadata),
@ -329,7 +329,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