Enforce readonly private members where possible.

This commit is contained in:
Dean Herbert
2017-03-23 13:41:50 +09:00
parent 5138890530
commit 54e1b24fe9
115 changed files with 278 additions and 259 deletions

View File

@ -15,8 +15,8 @@ namespace osu.Game.Overlays.Options
{
public class OptionDropdown<T> : FillFlowContainer
{
private Dropdown<T> dropdown;
private SpriteText text;
private readonly Dropdown<T> dropdown;
private readonly SpriteText text;
public string LabelText
{

View File

@ -14,8 +14,8 @@ namespace osu.Game.Overlays.Options
{
public class OptionSlider<T> : FillFlowContainer where T : struct
{
private SliderBar<T> slider;
private SpriteText text;
private readonly SliderBar<T> slider;
private readonly SpriteText text;
public string LabelText
{

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options
public abstract FontAwesome Icon { get; }
public abstract string Header { get; }
private SpriteText headerLabel;
private readonly SpriteText headerLabel;
protected OptionsSection()
{

View File

@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Options
{
protected override Container<Drawable> Content => content;
private Container<Drawable> content;
private readonly Container<Drawable> content;
protected abstract string Header { get; }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options
{
public class Sidebar : Container
{
private FillFlowContainer content;
private readonly FillFlowContainer content;
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
internal const int EXPANDED_WIDTH = 200;
protected override Container<Drawable> Content => content;

View File

@ -16,11 +16,11 @@ namespace osu.Game.Overlays.Options
{
public class SidebarButton : Container
{
private TextAwesome drawableIcon;
private SpriteText headerText;
private Box backgroundBox;
private Box selectionIndicator;
private Container text;
private readonly TextAwesome drawableIcon;
private readonly SpriteText headerText;
private readonly Box backgroundBox;
private readonly Box selectionIndicator;
private readonly Container text;
public Action Action;
private OptionsSection section;