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

@ -37,7 +37,7 @@ namespace osu.Game.Beatmaps
protected abstract HitObjectConverter<T> Converter { get; }
public DifficultyCalculator(Beatmap beatmap)
protected DifficultyCalculator(Beatmap beatmap)
{
Objects = Converter.Convert(beatmap);
PreprocessHitObjects();

View File

@ -6,7 +6,7 @@ using osu.Framework.Graphics.Sprites;
namespace osu.Game.Beatmaps.Drawables
{
class BeatmapBackgroundSprite : Sprite
internal class BeatmapBackgroundSprite : Sprite
{
private readonly WorkingBeatmap working;

View File

@ -10,7 +10,7 @@ using osu.Game.Database;
namespace osu.Game.Beatmaps.Drawables
{
class BeatmapGroup : IStateful<BeatmapGroupState>
internal class BeatmapGroup : IStateful<BeatmapGroupState>
{
public BeatmapPanel SelectedPanel;

View File

@ -18,7 +18,7 @@ using osu.Game.Graphics.Sprites;
namespace osu.Game.Beatmaps.Drawables
{
class BeatmapPanel : Panel
internal class BeatmapPanel : Panel
{
public BeatmapInfo Beatmap;
private Sprite background;

View File

@ -17,7 +17,7 @@ using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
class BeatmapSetHeader : Panel
internal class BeatmapSetHeader : Panel
{
public Action<BeatmapSetHeader> GainedSelection;
private SpriteText title, artist;
@ -96,7 +96,7 @@ namespace osu.Game.Beatmaps.Drawables
base.Dispose(isDisposing);
}
class PanelBackground : BufferedContainer
private class PanelBackground : BufferedContainer
{
private readonly WorkingBeatmap working;
@ -160,7 +160,7 @@ namespace osu.Game.Beatmaps.Drawables
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
FillMode = FillMode.Fill,
}.LoadAsync(game, (bg) =>
}.LoadAsync(game, bg =>
{
Add(bg);
ForceRedraw();

View File

@ -12,7 +12,7 @@ using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
class DifficultyIcon : Container
internal class DifficultyIcon : Container
{
private readonly BeatmapInfo beatmap;
private OsuColour palette;
@ -50,7 +50,7 @@ namespace osu.Game.Beatmaps.Drawables
};
}
enum DifficultyRating
private enum DifficultyRating
{
Easy,
Normal,

View File

@ -12,7 +12,7 @@ using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Beatmaps.Drawables
{
class Panel : Container, IStateful<PanelSelectedState>
internal class Panel : Container, IStateful<PanelSelectedState>
{
public const float MAX_HEIGHT = 80;
@ -115,7 +115,7 @@ namespace osu.Game.Beatmaps.Drawables
}
}
enum PanelSelectedState
internal enum PanelSelectedState
{
Hidden,
NotSelected,

View File

@ -17,8 +17,9 @@ namespace osu.Game.Beatmaps.Formats
public static BeatmapDecoder GetDecoder(TextReader stream)
{
var line = stream.ReadLine().Trim();
if (!decoders.ContainsKey(line))
var line = stream.ReadLine()?.Trim();
if (line == null || !decoders.ContainsKey(line))
throw new IOException(@"Unknown file format");
return (BeatmapDecoder)Activator.CreateInstance(decoders[line]);
}

View File

@ -197,7 +197,7 @@ namespace osu.Game.Beatmaps.Formats
if (split.Length > 2)
{
int kiaiFlags = split.Length > 7 ? Convert.ToInt32(split[7], NumberFormatInfo.InvariantInfo) : 0;
//int kiaiFlags = split.Length > 7 ? Convert.ToInt32(split[7], NumberFormatInfo.InvariantInfo) : 0;
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
cp = new ControlPoint
{
@ -219,15 +219,18 @@ namespace osu.Game.Beatmaps.Formats
throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}");
byte r, g, b;
if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b))
throw new InvalidOperationException($@"Color must be specified with 8-bit integer components");
throw new InvalidOperationException(@"Color must be specified with 8-bit integer components");
// Note: the combo index specified in the beatmap is discarded
beatmap.ComboColors.Add(new Color4
if (key.StartsWith(@"Combo"))
{
R = r / 255f,
G = g / 255f,
B = b / 255f,
A = 1f,
});
beatmap.ComboColors.Add(new Color4
{
R = r / 255f,
G = g / 255f,
B = b / 255f,
A = 1f,
});
}
}
protected override void ParseFile(TextReader stream, Beatmap beatmap)
@ -235,10 +238,9 @@ namespace osu.Game.Beatmaps.Formats
HitObjectParser parser = null;
var section = Section.None;
string line;
while (true)
{
line = stream.ReadLine();
var line = stream.ReadLine();
if (line == null)
break;
if (string.IsNullOrEmpty(line))

View File

@ -15,7 +15,8 @@ namespace osu.Game.Beatmaps.Timing
public double BeatLength;
public double VelocityAdjustment;
public bool TimingChange;
public bool KiaiMode;
}
internal enum TimeSignatures

View File

@ -3,7 +3,7 @@
namespace osu.Game.Beatmaps.Timing
{
class TimingChange : ControlPoint
internal class TimingChange : ControlPoint
{
public TimingChange(double beatLength)
{

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

View File

@ -15,9 +15,9 @@ namespace osu.Game.Database
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int? OnlineBeatmapID { get; set; } = null;
public int? OnlineBeatmapID { get; set; }
public int? OnlineBeatmapSetID { get; set; } = null;
public int? OnlineBeatmapSetID { get; set; }
[ForeignKey(typeof(BeatmapSetInfo))]
public int BeatmapSetInfoID { get; set; }
@ -57,7 +57,7 @@ namespace osu.Game.Database
{
get
{
return StoredBookmarks.Split(',').Select(b => int.Parse(b)).ToArray();
return StoredBookmarks.Split(',').Select(int.Parse).ToArray();
}
set
{
@ -77,7 +77,7 @@ namespace osu.Game.Database
{
get
{
return (starDifficulty < 0) ? (BaseDifficulty?.OverallDifficulty ?? 5) : starDifficulty;
return starDifficulty < 0 ? (BaseDifficulty?.OverallDifficulty ?? 5) : starDifficulty;
}
set { starDifficulty = value; }

View File

@ -10,7 +10,7 @@ namespace osu.Game.Database
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int? OnlineBeatmapSetID { get; set; } = null;
public int? OnlineBeatmapSetID { get; set; }
public string Title { get; set; }
public string TitleUnicode { get; set; }

View File

@ -12,7 +12,7 @@ namespace osu.Game.Database
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int? OnlineBeatmapSetID { get; set; } = null;
public int? OnlineBeatmapSetID { get; set; }
[OneToOne(CascadeOperations = CascadeOperation.All)]
public BeatmapMetadata Metadata { get; set; }

View File

@ -14,7 +14,7 @@ namespace osu.Game.Graphics.Backgrounds
{
public Sprite Sprite;
string textureName;
private string textureName;
public Background(string textureName = @"")
{

View File

@ -117,7 +117,7 @@ namespace osu.Game.Graphics.Backgrounds
private void addTriangle(bool randomY)
{
var sprite = CreateTriangle();
float triangleHeight = (sprite.DrawHeight / DrawHeight);
float triangleHeight = sprite.DrawHeight / DrawHeight;
sprite.Position = new Vector2(RNG.NextSingle(), randomY ? RNG.NextSingle() * (1 + triangleHeight) - triangleHeight : 1);
Add(sprite);
}

View File

@ -12,7 +12,7 @@ using osu.Framework.Configuration;
namespace osu.Game.Graphics.Containers
{
class ParallaxContainer : Container
internal class ParallaxContainer : Container
{
public float ParallaxAmount = 0.02f;
@ -51,7 +51,7 @@ namespace osu.Game.Graphics.Containers
};
}
bool firstUpdate = true;
private bool firstUpdate = true;
protected override void Update()
{

View File

@ -16,8 +16,7 @@ using osu.Framework.Graphics.Colour;
namespace osu.Game.Graphics.Cursor
{
class CursorTrail : Drawable
internal class CursorTrail : Drawable
{
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool HandleInput => true;
@ -46,7 +45,7 @@ namespace osu.Game.Graphics.Cursor
{
base.ApplyDrawNode(node);
TrailDrawNode tNode = node as TrailDrawNode;
TrailDrawNode tNode = (TrailDrawNode)node;
tNode.Shader = shader;
tNode.Texture = texture;
tNode.Size = size;
@ -117,7 +116,7 @@ namespace osu.Game.Graphics.Cursor
float distance = diff.Length;
Vector2 direction = diff / distance;
float interval = (size.X / 2) * 0.9f;
float interval = size.X / 2 * 0.9f;
for (float d = interval; d < distance; d += interval)
{
@ -137,7 +136,7 @@ namespace osu.Game.Graphics.Cursor
currentIndex = (currentIndex + 1) % max_sprites;
}
struct TrailPart
private struct TrailPart
{
public Vector2 Position;
public float Time;
@ -145,12 +144,12 @@ namespace osu.Game.Graphics.Cursor
public bool WasUpdated;
}
class TrailDrawNodeSharedData
private class TrailDrawNodeSharedData
{
public VertexBuffer<TexturedVertex2D> VertexBuffer;
}
class TrailDrawNode : DrawNode
private class TrailDrawNode : DrawNode
{
public Shader Shader;
public Texture Texture;

View File

@ -17,7 +17,7 @@ using System;
namespace osu.Game.Graphics.Cursor
{
class OsuCursorContainer : CursorContainer
internal class OsuCursorContainer : CursorContainer
{
protected override Drawable CreateCursor() => new OsuCursor();
@ -40,7 +40,7 @@ namespace osu.Game.Graphics.Cursor
return base.OnMouseUp(state, args);
}
class OsuCursor : Container
private class OsuCursor : Container
{
private Container cursorContainer;
private Bindable<double> cursorScale;

View File

@ -8,7 +8,7 @@ using osu.Framework.Graphics;
namespace osu.Game.Graphics.Processing
{
class RatioAdjust : Container
internal class RatioAdjust : Container
{
public override bool Contains(Vector2 screenSpacePos) => true;

View File

@ -100,7 +100,7 @@ namespace osu.Game.Graphics.UserInterface
Delay(click_duration);
Schedule(delegate {
colourContainer.ResizeTo(new Vector2(0.8f, 1f), 0, EasingTypes.None);
colourContainer.ResizeTo(new Vector2(0.8f, 1f));
spriteText.Spacing = Vector2.Zero;
glowContainer.FadeOut();
});

View File

@ -20,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface
private Box fill;
const float border_width = 3;
private const float border_width = 3;
private Color4 glowingColour, idleColour;
public Nub()

View File

@ -36,10 +36,7 @@ namespace osu.Game.Graphics.UserInterface
protected override void UpdateContentHeight()
{
if (State == DropDownMenuState.Opened)
ContentContainer.ResizeTo(new Vector2(1, ContentHeight), 300, EasingTypes.OutQuint);
else
ContentContainer.ResizeTo(new Vector2(1, 0), 300, EasingTypes.OutQuint);
ContentContainer.ResizeTo(State == DropDownMenuState.Opened ? new Vector2(1, ContentHeight) : new Vector2(1, 0), 300, EasingTypes.OutQuint);
}
}
}

View File

@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
public override void Apply(Drawable d)
{
base.Apply(d);
(d as PercentageCounter).DisplayedCount = CurrentValue;
((PercentageCounter)d).DisplayedCount = CurrentValue;
}
}
}

View File

@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface
/// Type of the Transform to use.
/// </summary>
/// <remarks>
/// Must be a subclass of Transform<T>
/// Must be a subclass of Transform(T)
/// </remarks>
protected virtual Type TransformType => typeof(Transform<T>);
@ -107,7 +107,7 @@ namespace osu.Game.Graphics.UserInterface
{
Children = new Drawable[]
{
DisplayedCountSpriteText = new OsuSpriteText()
DisplayedCountSpriteText = new OsuSpriteText
{
Font = @"Venera"
},

View File

@ -66,7 +66,7 @@ namespace osu.Game.Graphics.UserInterface
public override void Apply(Drawable d)
{
base.Apply(d);
(d as ScoreCounter).DisplayedCount = CurrentValue;
((ScoreCounter)d).DisplayedCount = CurrentValue;
}
}
}

View File

@ -145,7 +145,7 @@ namespace osu.Game.Graphics.UserInterface
}
}
class Star : Container
private class Star : Container
{
public TextAwesome Icon;
public Star()

View File

@ -87,7 +87,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
}
ScheduledDelegate popOutDelegate;
private ScheduledDelegate popOutDelegate;
private VolumeMeter volumeMeterEffect;
private VolumeMeter volumeMeterMusic;

View File

@ -8,7 +8,7 @@ using OpenTK.Input;
namespace osu.Game.Graphics.UserInterface.Volume
{
class VolumeControlReceptor : Container
internal class VolumeControlReceptor : Container
{
public Action<InputState> ActionRequested;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
internal class VolumeMeter : Container
{
private Box meterFill;
public BindableDouble Bindable { get; private set; } = new BindableDouble();
public BindableDouble Bindable { get; } = new BindableDouble();
public VolumeMeter(string meterName)
{

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using osu.Framework.Logging;
@ -9,7 +10,7 @@ using osu.Game.Database;
namespace osu.Game.IPC
{
public class BeatmapImporter
public class BeatmapImporter : IDisposable
{
private IpcChannel<BeatmapImportMessage> channel;
private BeatmapDatabase beatmaps;
@ -38,6 +39,11 @@ namespace osu.Game.IPC
ImportAsync(msg.Path).ContinueWith(t => Logger.Error(t.Exception, @"error during async import"), TaskContinuationOptions.OnlyOnFaulted);
}
public void Dispose()
{
throw new NotImplementedException();
}
}
public class BeatmapImportMessage

View File

@ -62,7 +62,7 @@ namespace osu.Game.Modes
public override string Description => @"You can't fail, no matter what.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect };
public override Mods[] DisablesMods => new[] { Mods.Relax, Mods.Autopilot, Mods.SuddenDeath, Mods.Perfect };
}
public abstract class ModEasy : Mod
@ -72,7 +72,7 @@ namespace osu.Game.Modes
public override string Description => @"Reduces overall difficulty - larger circles, more forgiving HP drain, less accuracy required.";
public override double ScoreMultiplier => 0.5;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.HardRock };
public override Mods[] DisablesMods => new[] { Mods.HardRock };
}
public abstract class ModHidden : Mod
@ -87,7 +87,7 @@ namespace osu.Game.Modes
public override Mods Name => Mods.HardRock;
public override FontAwesome Icon => FontAwesome.fa_osu_mod_hardrock;
public override string Description => @"Everything just got a bit harder...";
public override Mods[] DisablesMods => new Mods[] { Mods.Easy };
public override Mods[] DisablesMods => new[] { Mods.Easy };
}
public abstract class ModSuddenDeath : Mod
@ -97,7 +97,7 @@ namespace osu.Game.Modes
public override string Description => @"Miss a note and fail.";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema };
public override Mods[] DisablesMods => new[] { Mods.NoFail, Mods.Relax, Mods.Autopilot, Mods.Autoplay, Mods.Cinema };
}
public abstract class ModDoubleTime : Mod
@ -106,7 +106,7 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_doubletime;
public override string Description => @"Zoooooooooom";
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.HalfTime };
public override Mods[] DisablesMods => new[] { Mods.HalfTime };
}
public abstract class ModRelax : Mod
@ -115,7 +115,7 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax;
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect };
public override Mods[] DisablesMods => new[] { Mods.Autopilot, Mods.Autoplay, Mods.Cinema, Mods.NoFail, Mods.SuddenDeath, Mods.Perfect };
}
public abstract class ModHalfTime : Mod
@ -124,7 +124,7 @@ namespace osu.Game.Modes
public override FontAwesome Icon => FontAwesome.fa_osu_mod_halftime;
public override string Description => @"Less zoom";
public override bool Ranked => true;
public override Mods[] DisablesMods => new Mods[] { Mods.DoubleTime, Mods.Nightcore };
public override Mods[] DisablesMods => new[] { Mods.DoubleTime, Mods.Nightcore };
}
public abstract class ModNightcore : ModDoubleTime
@ -149,7 +149,7 @@ namespace osu.Game.Modes
public override string Description => @"Watch a perfect automated play through the song";
public override double ScoreMultiplier => 0;
public override bool Ranked => false;
public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect };
public override Mods[] DisablesMods => new[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect };
}
public abstract class ModPerfect : ModSuddenDeath

View File

@ -24,11 +24,11 @@ namespace osu.Game.Modes.Objects.Drawables
public JudgementInfo Judgement;
public abstract JudgementInfo CreateJudgementInfo();
protected abstract JudgementInfo CreateJudgementInfo();
public HitObject HitObject;
public DrawableHitObject(HitObject hitObject)
protected DrawableHitObject(HitObject hitObject)
{
HitObject = hitObject;
}
@ -52,12 +52,15 @@ namespace osu.Game.Modes.Objects.Drawables
}
}
SampleChannel sample;
private SampleChannel sample;
[BackgroundDependencyLoader]
private void load(AudioManager audio)
{
string hitType = ((HitObject.Sample?.Type ?? SampleType.None) == SampleType.None ? SampleType.Normal : HitObject.Sample.Type).ToString().ToLower();
SampleType type = HitObject.Sample?.Type ?? SampleType.None;
if (type == SampleType.None)
type = SampleType.Normal;
string hitType = type.ToString().ToLower();
string sampleSet = (HitObject.Sample?.Set ?? SampleSet.Normal).ToString().ToLower();
sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}");
@ -98,7 +101,6 @@ namespace osu.Game.Modes.Objects.Drawables
/// <summary>
/// Process a hit of this hitobject. Carries out judgement.
/// </summary>
/// <param name="judgement">Preliminary judgement information provided by the hit source.</param>
/// <returns>Whether a hit was processed.</returns>
protected bool UpdateJudgement(bool userTriggered)
{

View File

@ -10,7 +10,7 @@ namespace osu.Game.Modes
{
public abstract class ScoreProcessor
{
public virtual Score GetScore() => new Score()
public virtual Score GetScore() => new Score
{
TotalScore = TotalScore,
Combo = Combo,
@ -51,7 +51,7 @@ namespace osu.Game.Modes
/// Initializes a new instance of the <see cref="ScoreProcessor"/> class.
/// </summary>
/// <param name="hitObjectCount">Number of HitObjects. It is used for specifying Judgements collection Capacity</param>
public ScoreProcessor(int hitObjectCount = 0)
protected ScoreProcessor(int hitObjectCount = 0)
{
Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); };
Judgements = new List<JudgementInfo>(hitObjectCount);

View File

@ -260,7 +260,7 @@ namespace osu.Game.Modes.UI
public override void Apply(Drawable d)
{
base.Apply(d);
(d as ComboCounter).DisplayedCount = CurrentValue;
((ComboCounter)d).DisplayedCount = CurrentValue;
}
}

View File

@ -51,7 +51,7 @@ namespace osu.Game.Modes.UI
public override void Apply(Drawable d)
{
base.Apply(d);
(d as ComboResultCounter).DisplayedCount = CurrentValue;
((ComboResultCounter)d).DisplayedCount = CurrentValue;
}
}
}

View File

@ -17,10 +17,9 @@ namespace osu.Game.Modes.UI
{
public class HealthDisplay : Container
{
private Box background;
private Container fill;
public BindableDouble Current = new BindableDouble()
public BindableDouble Current = new BindableDouble
{
MinValue = 0,
MaxValue = 1
@ -30,7 +29,7 @@ namespace osu.Game.Modes.UI
{
Children = new Drawable[]
{
background = new Box
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,

View File

@ -54,7 +54,7 @@ namespace osu.Game.Modes.UI
protected virtual List<T> Convert(Beatmap beatmap) => Converter.Convert(beatmap);
public HitRenderer()
protected HitRenderer()
{
RelativeSizeAxes = Axes.Both;
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Modes.UI
}
private Color4 backgroundColour;
new public Color4 Colour
public new Color4 Colour
{
get
{

View File

@ -11,17 +11,16 @@ namespace osu.Game.Modes.UI
public abstract class Playfield : Container
{
public HitObjectContainer HitObjects;
private Container<Drawable> content;
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
public override bool Contains(Vector2 screenSpacePos) => true;
protected override Container<Drawable> Content => content;
protected override Container<Drawable> Content { get; }
public Playfield()
protected Playfield()
{
AddInternal(content = new ScaledContainer()
AddInternal(Content = new ScaledContainer
{
RelativeSizeAxes = Axes.Both,
});

View File

@ -50,7 +50,7 @@ namespace osu.Game.Modes.UI
AccuracyCounter?.Set(AccuracyCounter.Count - 0.01f);
}
public ScoreOverlay()
protected ScoreOverlay()
{
RelativeSizeAxes = Axes.Both;

View File

@ -20,10 +20,10 @@ namespace osu.Game.Online.API
private OAuth authentication;
public string Endpoint = @"https://new.ppy.sh";
const string client_id = @"5";
const string client_secret = @"FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk";
private const string client_id = @"5";
private const string client_secret = @"FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk";
ConcurrentQueue<APIRequest> queue = new ConcurrentQueue<APIRequest>();
private ConcurrentQueue<APIRequest> queue = new ConcurrentQueue<APIRequest>();
public Scheduler Scheduler = new Scheduler();
@ -38,22 +38,15 @@ namespace osu.Game.Online.API
public string Token
{
get { return authentication.Token?.ToString(); }
set
{
if (string.IsNullOrEmpty(value))
authentication.Token = null;
else
authentication.Token = OAuthToken.Parse(value);
}
set { authentication.Token = string.IsNullOrEmpty(value) ? null : OAuthToken.Parse(value); }
}
protected bool HasLogin => Token != null || (!string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password));
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable (should dispose of this or at very least keep a reference).
private Thread thread;
Logger log;
private Logger log;
public APIAccess()
{
@ -88,22 +81,22 @@ namespace osu.Game.Online.API
/// <summary>
/// Number of consecutive requests which failed due to network issues.
/// </summary>
int failureCount = 0;
private int failureCount;
private void run()
{
while (true)
while (thread.IsAlive)
{
switch (State)
{
case APIState.Failing:
//todo: replace this with a ping request.
log.Add($@"In a failing state, waiting a bit before we try again...");
log.Add(@"In a failing state, waiting a bit before we try again...");
Thread.Sleep(5000);
if (queue.Count == 0)
{
log.Add($@"Queueing a ping request");
Queue(new ListChannelsRequest() { Timeout = 5000 });
log.Add(@"Queueing a ping request");
Queue(new ListChannelsRequest { Timeout = 5000 });
}
break;
case APIState.Offline:
@ -131,7 +124,7 @@ namespace osu.Game.Online.API
var userReq = new GetUserRequest();
userReq.Success += (u) => {
userReq.Success += u => {
LocalUser.Value = u;
//we're connected!
State = APIState.Online;
@ -291,7 +284,7 @@ namespace osu.Game.Online.API
if (failOldRequests)
{
APIRequest req;
while (queue.TryDequeue(out req))
while (oldQueue.TryDequeue(out req))
req.Fail(new Exception(@"Disconnected from server"));
}
}

View File

@ -22,7 +22,7 @@ namespace osu.Game.Online.API
private void onSuccess()
{
Success?.Invoke((WebRequest as JsonWebRequest<T>).ResponseObject);
Success?.Invoke(((JsonWebRequest<T>)WebRequest).ResponseObject);
}
public new event APISuccessHandler<T> Success;

View File

@ -48,7 +48,7 @@ namespace osu.Game.Online.API
try
{
string[] parts = value.Split('/');
return new OAuthToken()
return new OAuthToken
{
AccessToken = parts[0],
AccessTokenExpiry = long.Parse(parts[1], NumberFormatInfo.InvariantInfo),

View File

@ -9,8 +9,8 @@ namespace osu.Game.Online.API.Requests
{
public class GetMessagesRequest : APIRequest<List<Message>>
{
List<Channel> channels;
long? since;
private List<Channel> channels;
private long? since;
public GetMessagesRequest(List<Channel> channels, long? sinceId)
{

View File

@ -1,55 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Diagnostics;
using System.Security;
using osu.Framework.Extensions;
namespace osu.Game.Online.API
{
internal class SecurePassword
{
private readonly SecureString storage = new SecureString();
private readonly Representation representation;
//todo: move this to a central constants file.
private const string password_entropy = @"cu24180ncjeiu0ci1nwui";
public SecurePassword(string input, bool encrypted = false)
{
//if (encrypted)
//{
// string rep;
// input = DPAPI.Decrypt(input, password_entropy, out rep);
// Enum.TryParse(rep, out representation);
//}
//else
{
representation = Representation.Raw;
}
foreach (char c in input)
storage.AppendChar(c);
storage.MakeReadOnly();
}
internal string Get(Representation request = Representation.Raw)
{
Debug.Assert(representation == request);
switch (request)
{
default:
return storage.UnsecureRepresentation();
//case Representation.Encrypted:
// return DPAPI.Encrypt(DPAPI.KeyType.UserKey, storage.UnsecureRepresentation(), password_entropy, representation.ToString());
}
}
}
enum Representation
{
Raw,
Encrypted
}
}

View File

@ -59,8 +59,8 @@ namespace osu.Game.Online.Chat.Drawables
return username_colours[message.UserId % username_colours.Length];
}
const float padding = 200;
const float text_size = 20;
private const float padding = 200;
private const float text_size = 20;
public ChatLine(Message message)
{

View File

@ -58,7 +58,7 @@ namespace osu.Game
public Bindable<PlayMode> PlayMode;
string[] args;
private string[] args;
private OptionsOverlay options;
@ -126,7 +126,7 @@ namespace osu.Game
//overlay elements
(chat = new ChatOverlay { Depth = 0 }).LoadAsync(this, overlayContent.Add);
(options = new OptionsOverlay { Depth = -1 }).LoadAsync(this, overlayContent.Add);
(musicController = new MusicController()
(musicController = new MusicController
{
Depth = -2,
Position = new Vector2(0, Toolbar.HEIGHT),
@ -200,9 +200,11 @@ namespace osu.Game
return true;
case Key.PageUp:
case Key.PageDown:
var rate = ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate * (args.Key == Key.PageUp ? 1.1f : 0.9f);
((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate = rate;
Logger.Log($@"Adjusting game clock to {rate}", LoggingTarget.Debug);
var swClock = (Clock as ThrottledFrameClock)?.Source as StopwatchClock;
if (swClock == null) return false;
swClock.Rate *= args.Key == Key.PageUp ? 1.1f : 0.9f;
Logger.Log($@"Adjusting game clock to {swClock.Rate}", LoggingTarget.Debug);
return true;
}

View File

@ -36,11 +36,11 @@ namespace osu.Game
private RatioAdjust ratioContainer;
public CursorContainer Cursor;
protected CursorContainer Cursor;
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName() { Version = new Version() };
protected AssemblyName AssemblyName => Assembly.GetEntryAssembly()?.GetName() ?? new AssemblyName { Version = new Version() };
public bool IsDeployedBuild => AssemblyName.Version.Major > 0;
@ -51,6 +51,7 @@ namespace osu.Game
bool isDebug = false;
// Debug.Assert conditions are only evaluated in debug mode
Debug.Assert(isDebug = true);
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
return isDebug;
}
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays
{
public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent
{
const float textbox_height = 40;
private const float textbox_height = 40;
private ScheduledDelegate messageRequest;

View File

@ -34,7 +34,7 @@ namespace osu.Game.Overlays
Children = new Drawable[]
{
fill = new Box()
fill = new Box
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,

View File

@ -13,11 +13,11 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays
{
class LoginOverlay : FocusedOverlayContainer
internal class LoginOverlay : FocusedOverlayContainer
{
private LoginOptions optionsSection;
const float transition_time = 400;
private const float transition_time = 400;
public LoginOverlay()
{

View File

@ -9,7 +9,7 @@ namespace osu.Game.Overlays.Mods
{
public class AssistedSection : ModSection
{
protected override Key[] ToggleKeys => new Key[] { Key.Z, Key.X, Key.C, Key.V, Key.B, Key.N, Key.M };
protected override Key[] ToggleKeys => new[] { Key.Z, Key.X, Key.C, Key.V, Key.B, Key.N, Key.M };
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -9,7 +9,7 @@ namespace osu.Game.Overlays.Mods
{
public class DifficultyIncreaseSection : ModSection
{
protected override Key[] ToggleKeys => new Key[] { Key.A, Key.S, Key.D, Key.F, Key.G, Key.H, Key.J, Key.K, Key.L };
protected override Key[] ToggleKeys => new[] { Key.A, Key.S, Key.D, Key.F, Key.G, Key.H, Key.J, Key.K, Key.L };
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -9,7 +9,7 @@ namespace osu.Game.Overlays.Mods
{
public class DifficultyReductionSection : ModSection
{
protected override Key[] ToggleKeys => new Key[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P };
protected override Key[] ToggleKeys => new[] { Key.Q, Key.W, Key.E, Key.R, Key.T, Key.Y, Key.U, Key.I, Key.O, Key.P };
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -113,23 +113,24 @@ namespace osu.Game.Overlays.Mods
if (mod is MultiMod)
{
mods = ((MultiMod)mod).Mods;
Mods = ((MultiMod)mod).Mods;
}
else
{
mods = new Mod[] { mod };
Mods = new[] { mod };
}
createIcons();
if (mods.Length > 0)
if (Mods.Length > 0)
{
displayMod(mods[0]);
displayMod(Mods[0]);
}
}
}
private Mod[] mods;
public Mod[] Mods => mods; // the mods from Mod, only multiple if Mod is a MultiMod
public Mod[] Mods { get; private set; }
// the mods from Mod, only multiple if Mod is a MultiMod
public Mod SelectedMod => Mods.ElementAtOrDefault(selectedMod);
@ -202,7 +203,7 @@ namespace osu.Game.Overlays.Mods
{
if (Mods.Length > 1)
{
iconsContainer.Add(icons = new ModIcon[]
iconsContainer.Add(icons = new[]
{
new ModIcon
{
@ -222,7 +223,7 @@ namespace osu.Game.Overlays.Mods
}
else
{
iconsContainer.Add(icons = new ModIcon[]
iconsContainer.Add(icons = new[]
{
new ModIcon
{

View File

@ -15,7 +15,7 @@ using osu.Game.Modes;
namespace osu.Game.Overlays.Mods
{
class AlwaysPresentFlowContainer : FillFlowContainer
internal class AlwaysPresentFlowContainer : FillFlowContainer
{
public override bool IsPresent => true;
}
@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Mods
}
private Color4 colour = Color4.White;
new public Color4 Colour
public new Color4 Colour
{
get
{

View File

@ -59,7 +59,7 @@ namespace osu.Game.Overlays
protected override bool OnDrag(InputState state)
{
Vector2 change = (state.Mouse.Position - state.Mouse.PositionMouseDown.Value);
Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
// Diminish the drag distance as we go further to simulate "rubber band" feeling.
change *= (float)Math.Pow(change.Length, 0.7f) / change.Length;
@ -246,14 +246,14 @@ namespace osu.Game.Overlays
}
}
void preferUnicode_changed(object sender, EventArgs e)
private void preferUnicode_changed(object sender, EventArgs e)
{
updateDisplay(current, TransformDirection.None);
}
private void workingChanged(object sender = null, EventArgs e = null)
{
progress.IsEnabled = (beatmapSource.Value != null);
progress.IsEnabled = beatmapSource.Value != null;
if (beatmapSource.Value == current) return;
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmapSource?.Value?.BeatmapInfo) ?? false;
current = beatmapSource.Value;
@ -323,7 +323,7 @@ namespace osu.Game.Overlays
updateDisplay(current, isNext ? TransformDirection.Next : TransformDirection.Prev);
}
Action pendingBeatmapSwitch;
private Action pendingBeatmapSwitch;
private void updateDisplay(WorkingBeatmap beatmap, TransformDirection direction)
{
@ -384,7 +384,7 @@ namespace osu.Game.Overlays
base.Dispose(isDisposing);
}
const float transition_length = 800;
private const float transition_length = 800;
protected override void PopIn()
{

View File

@ -69,7 +69,7 @@ namespace osu.Game.Overlays
};
}
int runningDepth = 0;
private int runningDepth;
public void Post(Notification notification)
{

View File

@ -43,16 +43,7 @@ namespace osu.Game.Overlays.Notifications
protected Container NotificationContent;
private bool read;
public virtual bool Read
{
get { return read; }
set
{
read = value;
}
}
public virtual bool Read { get; set; }
public Notification()
{
@ -162,7 +153,7 @@ namespace osu.Game.Overlays.Notifications
Expire();
}
class CloseButton : ClickableContainer
private class CloseButton : ClickableContainer
{
private Color4 hoverColour;

View File

@ -133,7 +133,7 @@ namespace osu.Game.Overlays.Notifications
countText.Text = notifications.Children.Count(c => c.Alpha > 0.99f).ToString();
}
class ClearAllButton : ClickableContainer
private class ClearAllButton : ClickableContainer
{
private OsuSpriteText text;

View File

@ -168,7 +168,7 @@ namespace osu.Game.Overlays.Notifications
/// </summary>
public Func<bool> CompletionClickAction;
class ProgressBar : Container
private class ProgressBar : Container
{
private Box box;

View File

@ -46,12 +46,12 @@ namespace osu.Game.Overlays.Options
private Bindable<T> bindable;
void bindable_ValueChanged(object sender, EventArgs e)
private void bindable_ValueChanged(object sender, EventArgs e)
{
dropdown.SelectedValue = bindable.Value;
}
void dropdown_ValueChanged(object sender, EventArgs e)
private void dropdown_ValueChanged(object sender, EventArgs e)
{
bindable.Value = dropdown.SelectedValue;
}

View File

@ -7,7 +7,7 @@ using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
class OptionLabel : OsuSpriteText
internal class OptionLabel : OsuSpriteText
{
[BackgroundDependencyLoader]
private void load(OsuColour colour)

View File

@ -11,8 +11,7 @@ namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : FillFlowContainer
{
private Container<Drawable> content;
protected override Container<Drawable> Content => content;
protected override Container<Drawable> Content { get; }
protected abstract string Header { get; }
@ -29,7 +28,7 @@ namespace osu.Game.Overlays.Options
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FillFlowContainer
Content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),

View File

@ -32,12 +32,11 @@ namespace osu.Game.Overlays.Options.Sections.Audio
private void updateItems()
{
var deviceItems = new List<KeyValuePair<string, string>>();
deviceItems.Add(new KeyValuePair<string, string>("Default", string.Empty));
var deviceItems = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("Default", string.Empty) };
deviceItems.AddRange(audio.AudioDeviceNames.Select(d => new KeyValuePair<string, string>(d, d)));
var preferredDeviceName = audio.AudioDevice.Value;
if (!deviceItems.Any(kv => kv.Value == preferredDeviceName))
if (deviceItems.All(kv => kv.Value != preferredDeviceName))
deviceItems.Add(new KeyValuePair<string, string>(preferredDeviceName, preferredDeviceName));
dropdown.Items = deviceItems;
@ -51,7 +50,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
Children = new Drawable[]
{
dropdown = new OptionDropDown<string>()
dropdown = new OptionDropDown<string>
{
Bindable = audio.AudioDevice
},

View File

@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Options.Sections.General
}
}
class LoginForm : FillFlowContainer
private class LoginForm : FillFlowContainer
{
private TextBox username;
private TextBox password;

View File

@ -50,7 +50,7 @@ namespace osu.Game.Overlays.Toolbar
Children = new Drawable[]
{
new ToolbarSettingsButton(),
new ToolbarHomeButton()
new ToolbarHomeButton
{
Action = () => OnHome?.Invoke()
},
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Toolbar
FadeOut(transition_time);
}
class PassThroughFlowContainer : FillFlowContainer
private class PassThroughFlowContainer : FillFlowContainer
{
//needed to get input to the login overlay.
public override bool Contains(Vector2 screenSpacePos) => true;

View File

@ -5,7 +5,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarHomeButton : ToolbarButton
internal class ToolbarHomeButton : ToolbarButton
{
public ToolbarHomeButton()
{

View File

@ -15,9 +15,9 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarModeSelector : Container
internal class ToolbarModeSelector : Container
{
const float padding = 10;
private const float padding = 10;
private FillFlowContainer modeButtons;
private Drawable modeButtonLine;
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Toolbar
{
RelativeSizeAxes = Axes.Y;
Children = new Drawable[]
Children = new[]
{
new OpaqueBackground(),
modeButtons = new FillFlowContainer

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarMusicButton : ToolbarOverlayToggleButton
internal class ToolbarMusicButton : ToolbarOverlayToggleButton
{
public ToolbarMusicButton()
{

View File

@ -7,7 +7,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarNotificationButton : ToolbarOverlayToggleButton
internal class ToolbarNotificationButton : ToolbarOverlayToggleButton
{
protected override Anchor TooltipAnchor => Anchor.TopRight;

View File

@ -9,7 +9,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarOverlayToggleButton : ToolbarButton
internal class ToolbarOverlayToggleButton : ToolbarButton
{
private Box stateBackground;

View File

@ -6,7 +6,7 @@ using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarSettingsButton : ToolbarOverlayToggleButton
internal class ToolbarSettingsButton : ToolbarOverlayToggleButton
{
public ToolbarSettingsButton()
{

View File

@ -8,7 +8,7 @@ using OpenTK;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarUserArea : Container
internal class ToolbarUserArea : Container
{
public LoginOverlay LoginOverlay;
private ToolbarUserButton button;

View File

@ -14,7 +14,7 @@ using OpenTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarUserButton : ToolbarButton, IOnlineComponent
internal class ToolbarUserButton : ToolbarButton, IOnlineComponent
{
private Avatar avatar;

View File

@ -19,8 +19,8 @@ namespace osu.Game.Screens
return other?.GetType() == GetType();
}
const float transition_length = 500;
const float x_movement_amount = 50;
private const float transition_length = 500;
private const float x_movement_amount = 50;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
@ -28,7 +28,7 @@ namespace osu.Game.Screens
return false;
}
Framework.Game game;
private Framework.Game game;
[BackgroundDependencyLoader]
private void load(Framework.Game game)
@ -58,7 +58,7 @@ namespace osu.Game.Screens
protected override void Update()
{
base.Update();
Content.Scale = new Vector2(1 + (x_movement_amount / DrawSize.X) * 2);
Content.Scale = new Vector2(1 + x_movement_amount / DrawSize.X * 2);
}
protected override void OnEntering(Screen last)

View File

@ -68,10 +68,13 @@ namespace osu.Game.Screens.Backgrounds
public override bool Equals(BackgroundScreen other)
{
return base.Equals(other) && beatmap == ((BackgroundScreenBeatmap)other).Beatmap;
var otherBeatmapBackground = (BackgroundScreenBeatmap)other;
if (otherBeatmapBackground == null) return false;
return base.Equals(other) && beatmap == otherBeatmapBackground.Beatmap;
}
class BeatmapBackground : Background
private class BeatmapBackground : Background
{
private WorkingBeatmap beatmap;

View File

@ -17,7 +17,10 @@ namespace osu.Game.Screens.Backgrounds
public override bool Equals(BackgroundScreen other)
{
return base.Equals(other) && textureName == ((BackgroundScreenCustom)other).textureName;
var backgroundScreenCustom = (BackgroundScreenCustom)other;
if (backgroundScreenCustom == null) return false;
return base.Equals(other) && textureName == backgroundScreenCustom.textureName;
}
}
}

View File

@ -3,7 +3,7 @@
namespace osu.Game.Screens.Charts
{
class ChartInfo : ScreenWhiteBox
internal class ChartInfo : ScreenWhiteBox
{
}
}

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Charts
{
class ChartListing : ScreenWhiteBox
internal class ChartListing : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(ChartInfo)

View File

@ -3,7 +3,7 @@
namespace osu.Game.Screens.Direct
{
class OnlineListing : ScreenWhiteBox
internal class OnlineListing : ScreenWhiteBox
{
}
}

View File

@ -7,7 +7,7 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Edit
{
class Editor : ScreenWhiteBox
internal class Editor : ScreenWhiteBox
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");

View File

@ -21,7 +21,7 @@ namespace osu.Game.Screens
{
private BackButton popButton;
const int transition_time = 1000;
private const int transition_time = 1000;
protected virtual IEnumerable<Type> PossibleChildren => null;
@ -56,7 +56,7 @@ namespace osu.Game.Screens
protected override bool OnExiting(Screen next)
{
textContainer.MoveTo(new Vector2((DrawSize.X / 16), 0), transition_time, EasingTypes.OutExpo);
textContainer.MoveTo(new Vector2(DrawSize.X / 16, 0), transition_time, EasingTypes.OutExpo);
Content.FadeOut(transition_time, EasingTypes.OutExpo);
return base.OnExiting(next);

View File

@ -7,7 +7,7 @@ using osu.Game.Screens.Menu;
namespace osu.Game.Screens
{
class Loader : OsuScreen
internal class Loader : OsuScreen
{
internal override bool ShowOverlays => false;

View File

@ -292,7 +292,7 @@ namespace osu.Game.Screens.Menu
public int ContractStyle;
ButtonState state;
private ButtonState state;
public ButtonState State
{

View File

@ -49,8 +49,8 @@ namespace osu.Game.Screens.Menu
private Button backButton;
private Button settingsButton;
List<Button> buttonsTopLevel = new List<Button>();
List<Button> buttonsPlay = new List<Button>();
private List<Button> buttonsTopLevel = new List<Button>();
private List<Button> buttonsPlay = new List<Button>();
public ButtonSystem()
{
@ -187,7 +187,7 @@ namespace osu.Game.Screens.Menu
}
}
MenuState state;
private MenuState state;
public override bool HandleInput => state != MenuState.Exit;

View File

@ -13,7 +13,7 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Menu
{
class Disclaimer : OsuScreen
internal class Disclaimer : OsuScreen
{
private Intro intro;
private TextAwesome icon;

View File

@ -23,7 +23,7 @@ namespace osu.Game.Screens.Menu
/// </summary>
internal bool DidLoadMenu;
MainMenu mainMenu;
private MainMenu mainMenu;
private SampleChannel welcome;
private SampleChannel seeya;
private Track bgm;

View File

@ -141,7 +141,7 @@ namespace osu.Game.Screens.Menu
Origin = Anchor.Centre,
Children = new Drawable[]
{
ripple = new Sprite()
ripple = new Sprite
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Multiplayer
{
class Lobby : ScreenWhiteBox
internal class Lobby : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(MatchCreate),

View File

@ -11,7 +11,7 @@ using osu.Game.Screens.Select;
namespace osu.Game.Screens.Multiplayer
{
class Match : ScreenWhiteBox
internal class Match : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(MatchSongSelect),

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace osu.Game.Screens.Multiplayer
{
class MatchCreate : ScreenWhiteBox
internal class MatchCreate : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(Match)

View File

@ -10,7 +10,7 @@ using OpenTK.Graphics;
namespace osu.Game.Screens.Play
{
class FailDialog : OsuScreen
internal class FailDialog : OsuScreen
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);

View File

@ -49,7 +49,7 @@ namespace osu.Game.Screens.Play
}
}
private int fadeTime = 0;
private int fadeTime;
public int FadeTime
{
get { return fadeTime; }

View File

@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play
},
new OsuSpriteText
{
Text = $" time{((value == 1) ? "" : "s")} in this session",
Text = $" time{(value == 1 ? "" : "s")} in this session",
Shadow = true,
ShadowColour = new Color4(0, 0, 0, 0.25f),
TextSize = 18

View File

@ -39,21 +39,14 @@ namespace osu.Game.Screens.Play
public PlayMode PreferredPlayMode;
private bool isPaused;
public bool IsPaused
{
get
{
return isPaused;
}
}
public bool IsPaused { get; private set; }
public int RestartCount;
private double pauseCooldown = 1000;
private double lastPauseActionTime = 0;
private double lastPauseActionTime;
private bool canPause => Time.Current >= (lastPauseActionTime + pauseCooldown);
private bool canPause => Time.Current >= lastPauseActionTime + pauseCooldown;
private IAdjustableClock sourceClock;
@ -198,11 +191,11 @@ namespace osu.Game.Screens.Play
pauseOverlay.Retries = RestartCount;
pauseOverlay.Show();
sourceClock.Stop();
isPaused = true;
IsPaused = true;
}
else
{
isPaused = false;
IsPaused = false;
}
}
@ -212,12 +205,12 @@ namespace osu.Game.Screens.Play
scoreOverlay.KeyCounter.IsCounting = true;
pauseOverlay.Hide();
sourceClock.Start();
isPaused = false;
IsPaused = false;
}
public void TogglePaused()
{
isPaused = !IsPaused;
IsPaused = !IsPaused;
if (IsPaused) Pause(); else Resume();
}
@ -327,6 +320,6 @@ namespace osu.Game.Screens.Play
private Bindable<bool> mouseWheelDisabled;
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !isPaused;
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
}
}

View File

@ -10,11 +10,11 @@ using System.Linq;
namespace osu.Game.Screens.Play
{
class PlayerInputManager : UserInputManager
internal class PlayerInputManager : UserInputManager
{
bool leftViaKeyboard;
bool rightViaKeyboard;
Bindable<bool> mouseDisabled;
private bool leftViaKeyboard;
private bool rightViaKeyboard;
private Bindable<bool> mouseDisabled;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)

View File

@ -95,9 +95,9 @@ namespace osu.Game.Screens.Play
return base.OnExiting(next);
}
class BeatmapMetadataDisplay : Container
private class BeatmapMetadataDisplay : Container
{
class MetadataLine : Container
private class MetadataLine : Container
{
public MetadataLine(string left, string right)
{
@ -131,7 +131,7 @@ namespace osu.Game.Screens.Play
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
{
new FillFlowContainer()
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Origin = Anchor.TopCentre,

Some files were not shown because too many files have changed in this diff Show More