1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Fix many warnings

This commit is contained in:
Dean Herbert 2018-03-24 18:22:55 +09:00
parent 9d9b9d50bc
commit 0e669c9a3f
16 changed files with 14 additions and 17 deletions

@ -1 +1 @@
Subproject commit 7eb292e9ec09a18a50c0619e34a4a06ae155b49b Subproject commit ae633287dc44517f3f5fc66f1d0f5333f76cc261

View File

@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps
/// <summary> /// <summary>
/// Converts a Beatmap using this Beatmap Converter. /// Converts a Beatmap using this Beatmap Converter.
/// </summary> /// </summary>
/// <param name="original">The un-converted Beatmap.</param> /// <param name="beatmap">The un-converted Beatmap.</param>
void Convert(Beatmap beatmap); void Convert(Beatmap beatmap);
} }
} }

View File

@ -11,9 +11,6 @@ namespace osu.Game.Database
{ {
protected readonly Storage Storage; protected readonly Storage Storage;
/// <summary>
/// Create a new <see cref="OsuDbContext"/> instance (separate from the shared context via <see cref="GetContext"/> for performing isolated operations.
/// </summary>
protected readonly IDatabaseContextFactory ContextFactory; protected readonly IDatabaseContextFactory ContextFactory;
/// <summary> /// <summary>

View File

@ -17,7 +17,7 @@ namespace osu.Game.Database
private readonly object writeLock = new object(); private readonly object writeLock = new object();
private bool currentWriteDidWrite; private bool currentWriteDidWrite;
private volatile int currentWriteUsages; private int currentWriteUsages;
public DatabaseContextFactory(GameHost host) public DatabaseContextFactory(GameHost host)
{ {

View File

@ -6,7 +6,6 @@ using Humanizer;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Threading;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics namespace osu.Game.Graphics
@ -14,7 +13,6 @@ namespace osu.Game.Graphics
public class DrawableDate : OsuSpriteText, IHasTooltip public class DrawableDate : OsuSpriteText, IHasTooltip
{ {
private readonly DateTimeOffset date; private readonly DateTimeOffset date;
private ScheduledDelegate updateTask;
public DrawableDate(DateTimeOffset date) public DrawableDate(DateTimeOffset date)
{ {
@ -61,6 +59,7 @@ namespace osu.Game.Graphics
public override bool HandleMouseInput => true; public override bool HandleMouseInput => true;
private void updateTime() => Text = date.Humanize(); private void updateTime() => Text = date.Humanize();
public string TooltipText => date.ToString(); public string TooltipText => date.ToString();
} }
} }

View File

@ -64,7 +64,7 @@ namespace osu.Game.Online.API
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>(); private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
internal void Schedule(Action action) => base.Schedule(action); internal new void Schedule(Action action) => base.Schedule(action);
public void Register(IOnlineComponent component) public void Register(IOnlineComponent component)
{ {

View File

@ -33,6 +33,7 @@ namespace osu.Game.Rulesets.Judgements
/// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>. /// Creates a drawable which visualises a <see cref="Judgements.Judgement"/>.
/// </summary> /// </summary>
/// <param name="judgement">The judgement to visualise.</param> /// <param name="judgement">The judgement to visualise.</param>
/// <param name="judgedObject">The object which was judged.</param>
public DrawableJudgement(Judgement judgement, DrawableHitObject judgedObject) public DrawableJudgement(Judgement judgement, DrawableHitObject judgedObject)
{ {
Judgement = judgement; Judgement = judgement;

View File

@ -15,7 +15,6 @@ namespace osu.Game.Rulesets.Replays.Types
/// Populates this <see cref="ReplayFrame"/> using values from a <see cref="LegacyReplayFrame"/>. /// Populates this <see cref="ReplayFrame"/> using values from a <see cref="LegacyReplayFrame"/>.
/// </summary> /// </summary>
/// <param name="legacyFrame">The <see cref="LegacyReplayFrame"/> to extract values from.</param> /// <param name="legacyFrame">The <see cref="LegacyReplayFrame"/> to extract values from.</param>
/// <param name="score">The score.</param>
/// <param name="beatmap">The beatmap.</param> /// <param name="beatmap">The beatmap.</param>
void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap); void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap);
} }

View File

@ -24,7 +24,6 @@ namespace osu.Game.Screens.Edit.Screens.Compose
public class BeatDivisorControl : CompositeDrawable public class BeatDivisorControl : CompositeDrawable
{ {
private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor(); private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor();
private int currentDivisorIndex;
public BeatDivisorControl(BindableBeatDivisor beatDivisor) public BeatDivisorControl(BindableBeatDivisor beatDivisor)
{ {

View File

@ -547,6 +547,7 @@ namespace osu.Game.Screens.Select
float? setY = null; float? setY = null;
if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override. if (!d.IsLoaded || beatmap.Alpha == 0) // can't use IsPresent due to DrawableCarouselItem override.
// ReSharper disable once PossibleNullReferenceException (resharper broken?)
setY = lastSet.Y + lastSet.DrawHeight + 5; setY = lastSet.Y + lastSet.DrawHeight + 5;
if (d.IsLoaded) if (d.IsLoaded)

View File

@ -254,7 +254,7 @@ namespace osu.Game.Screens.Select
private OsuSpriteText[] getMapper(BeatmapMetadata metadata) private OsuSpriteText[] getMapper(BeatmapMetadata metadata)
{ {
if (string.IsNullOrEmpty(metadata.Author?.Username)) if (metadata.Author == null || string.IsNullOrEmpty(metadata.Author.Username))
return Array.Empty<OsuSpriteText>(); return Array.Empty<OsuSpriteText>();
return new[] return new[]

View File

@ -3,6 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using OpenTK.Input; using OpenTK.Input;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
@ -75,7 +76,8 @@ namespace osu.Game.Screens.Select
{ {
// if we have no beatmaps but osu-stable is found, let's prompt the user to import. // if we have no beatmaps but osu-stable is found, let's prompt the user to import.
if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable) if (!beatmaps.GetAllUsableBeatmapSets().Any() && beatmaps.StableInstallationAvailable)
dialogOverlay.Push(new ImportFromStablePopup(() => beatmaps.ImportFromStable())); dialogOverlay.Push(new ImportFromStablePopup(() =>
Task.Factory.StartNew(beatmaps.ImportFromStable, TaskCreationOptions.LongRunning)));
}); });
} }
} }

View File

@ -80,8 +80,6 @@ namespace osu.Game.Skinning
return new LegacySkin(skinInfo, Files.Store, audio); return new LegacySkin(skinInfo, Files.Store, audio);
} }
private SkinStore store;
public SkinManager(Storage storage, DatabaseContextFactory contextFactory, IIpcHost importHost, AudioManager audio) public SkinManager(Storage storage, DatabaseContextFactory contextFactory, IIpcHost importHost, AudioManager audio)
: base(storage, contextFactory, new SkinStore(contextFactory, storage), importHost) : base(storage, contextFactory, new SkinStore(contextFactory, storage), importHost)
{ {

View File

@ -23,7 +23,7 @@ namespace osu.Game.Skinning
/// <summary> /// <summary>
/// Create a new <see cref="SkinReloadableDrawable"/> /// Create a new <see cref="SkinReloadableDrawable"/>
/// </summary> /// </summary>
/// <param name="fallback">Whether fallback to default skin should be allowed if the custom skin is missing this resource.</param> /// <param name="allowFallback">A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present.</param>
protected SkinReloadableDrawable(Func<ISkinSource, bool> allowFallback = null) protected SkinReloadableDrawable(Func<ISkinSource, bool> allowFallback = null)
{ {
this.allowFallback = allowFallback; this.allowFallback = allowFallback;

View File

@ -29,7 +29,7 @@ namespace osu.Game.Skinning
/// </summary> /// </summary>
/// <param name="name">The namespace-complete resource name for this skinnable element.</param> /// <param name="name">The namespace-complete resource name for this skinnable element.</param>
/// <param name="defaultImplementation">A function to create the default skin implementation of this element.</param> /// <param name="defaultImplementation">A function to create the default skin implementation of this element.</param>
/// <param name="fallback">Whther to fallback to the default implementation when a custom skin is specified but not implementation is present.</param> /// <param name="allowFallback">A conditional to decide whether to allow fallback to the default implementation if a skinned element is not present.</param>
/// <param name="restrictSize">Whether a user-skin drawable should be limited to the size of our parent.</param> /// <param name="restrictSize">Whether a user-skin drawable should be limited to the size of our parent.</param>
public SkinnableDrawable(string name, Func<string, T> defaultImplementation, Func<ISkinSource, bool> allowFallback = null, bool restrictSize = true) : base(allowFallback) public SkinnableDrawable(string name, Func<string, T> defaultImplementation, Func<ISkinSource, bool> allowFallback = null, bool restrictSize = true) : base(allowFallback)
{ {

View File

@ -43,6 +43,7 @@
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002ELocal/@EntryIndexedValue">WARNING</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=FieldCanBeMadeReadOnly_002ELocal/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">WARNING</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ForCanBeConvertedToForeach/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ImpureMethodCallOnReadonlyValueField/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">ERROR</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InconsistentNaming/@EntryIndexedValue">ERROR</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InheritdocConsiderUsage/@EntryIndexedValue">HINT</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InheritdocConsiderUsage/@EntryIndexedValue">HINT</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InlineOutVariableDeclaration/@EntryIndexedValue">HINT</s:String> <s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InlineOutVariableDeclaration/@EntryIndexedValue">HINT</s:String>