mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Enforce readonly private members where possible.
This commit is contained in:
@ -60,18 +60,18 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
private List<float> yPositions = new List<float>();
|
||||
private readonly List<float> yPositions = new List<float>();
|
||||
|
||||
/// <summary>
|
||||
/// Required for now unfortunately.
|
||||
/// </summary>
|
||||
private BeatmapDatabase database;
|
||||
|
||||
private Container<Panel> scrollableContent;
|
||||
private readonly Container<Panel> scrollableContent;
|
||||
|
||||
private List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
||||
private readonly List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
||||
|
||||
private List<Panel> panels = new List<Panel>();
|
||||
private readonly List<Panel> panels = new List<Panel>();
|
||||
|
||||
private BeatmapGroup selectedGroup;
|
||||
|
||||
|
@ -24,9 +24,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public Action<FilterCriteria> FilterChanged;
|
||||
|
||||
private OsuTabControl<SortMode> sortTabs;
|
||||
private readonly OsuTabControl<SortMode> sortTabs;
|
||||
|
||||
private TabControl<GroupMode> groupTabs;
|
||||
private readonly TabControl<GroupMode> groupTabs;
|
||||
|
||||
private SortMode sort = SortMode.Title;
|
||||
public SortMode Sort
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public Action Exit;
|
||||
|
||||
private SearchTextBox searchTextBox;
|
||||
private readonly SearchTextBox searchTextBox;
|
||||
|
||||
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class Footer : Container
|
||||
{
|
||||
private Box modeLight;
|
||||
private readonly Box modeLight;
|
||||
|
||||
private const float play_song_select_button_width = 100;
|
||||
private const float play_song_select_button_height = 50;
|
||||
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select
|
||||
public Action OnBack;
|
||||
public Action OnStart;
|
||||
|
||||
private FillFlowContainer buttons;
|
||||
private readonly FillFlowContainer buttons;
|
||||
|
||||
public OsuLogo StartButton;
|
||||
|
||||
|
@ -51,9 +51,9 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
private SpriteText spriteText;
|
||||
private Box box;
|
||||
private Box light;
|
||||
private readonly SpriteText spriteText;
|
||||
private readonly Box box;
|
||||
private readonly Box light;
|
||||
|
||||
public FooterButton()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
public class DrawableRank : Container
|
||||
{
|
||||
private Sprite sprite;
|
||||
private readonly Sprite sprite;
|
||||
|
||||
public ScoreRank Rank { get; private set; }
|
||||
|
||||
|
@ -16,8 +16,8 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
public class Leaderboard : Container
|
||||
{
|
||||
private ScrollContainer scrollContainer;
|
||||
private FillFlowContainer<LeaderboardScore> scrollFlow;
|
||||
private readonly ScrollContainer scrollContainer;
|
||||
private readonly FillFlowContainer<LeaderboardScore> scrollFlow;
|
||||
|
||||
private IEnumerable<Score> scores;
|
||||
public IEnumerable<Score> Scores
|
||||
|
@ -30,14 +30,16 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
private const float background_alpha = 0.25f;
|
||||
private const float rank_width = 30;
|
||||
|
||||
private Box background;
|
||||
private Container content, avatar;
|
||||
private DrawableRank scoreRank;
|
||||
private OsuSpriteText nameLabel;
|
||||
private GlowingSpriteText scoreLabel;
|
||||
private ScoreComponentLabel maxCombo, accuracy;
|
||||
private Container flagBadgeContainer;
|
||||
private FillFlowContainer<ScoreModIcon> modsContainer;
|
||||
private readonly Box background;
|
||||
private readonly Container content;
|
||||
private readonly Container avatar;
|
||||
private readonly DrawableRank scoreRank;
|
||||
private readonly OsuSpriteText nameLabel;
|
||||
private readonly GlowingSpriteText scoreLabel;
|
||||
private readonly ScoreComponentLabel maxCombo;
|
||||
private readonly ScoreComponentLabel accuracy;
|
||||
private readonly Container flagBadgeContainer;
|
||||
private readonly FillFlowContainer<ScoreModIcon> modsContainer;
|
||||
|
||||
private Visibility state;
|
||||
public Visibility State
|
||||
|
@ -20,10 +20,12 @@ namespace osu.Game.Screens.Select.Options
|
||||
{
|
||||
private static readonly float width = 130;
|
||||
|
||||
private Box background, flash;
|
||||
private TextAwesome iconText;
|
||||
private OsuSpriteText firstLine, secondLine;
|
||||
private Container box;
|
||||
private readonly Box background;
|
||||
private readonly Box flash;
|
||||
private readonly TextAwesome iconText;
|
||||
private readonly OsuSpriteText firstLine;
|
||||
private readonly OsuSpriteText secondLine;
|
||||
private readonly Container box;
|
||||
|
||||
public Color4 ButtonColour
|
||||
{
|
||||
|
@ -24,8 +24,8 @@ namespace osu.Game.Screens.Select.Options
|
||||
|
||||
private const float height = 100;
|
||||
|
||||
private Box holder;
|
||||
private FillFlowContainer<BeatmapOptionsButton> buttonsContainer;
|
||||
private readonly Box holder;
|
||||
private readonly FillFlowContainer<BeatmapOptionsButton> buttonsContainer;
|
||||
|
||||
protected override void PopIn()
|
||||
{
|
||||
|
@ -19,8 +19,8 @@ namespace osu.Game.Screens.Select
|
||||
public class PlaySongSelect : SongSelect
|
||||
{
|
||||
private OsuScreen player;
|
||||
private ModSelectOverlay modSelect;
|
||||
private Leaderboard leaderboard;
|
||||
private readonly ModSelectOverlay modSelect;
|
||||
private readonly Leaderboard leaderboard;
|
||||
|
||||
public PlaySongSelect()
|
||||
{
|
||||
|
@ -31,20 +31,19 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
public abstract class SongSelect : OsuScreen
|
||||
{
|
||||
private Bindable<PlayMode> playMode = new Bindable<PlayMode>();
|
||||
private readonly Bindable<PlayMode> playMode = new Bindable<PlayMode>();
|
||||
private BeatmapDatabase database;
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
|
||||
|
||||
private BeatmapCarousel carousel;
|
||||
private readonly BeatmapCarousel carousel;
|
||||
private TrackManager trackManager;
|
||||
private DialogOverlay dialogOverlay;
|
||||
|
||||
|
||||
private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 245);
|
||||
|
||||
private const float left_area_padding = 20;
|
||||
|
||||
private BeatmapInfoWedge beatmapInfoWedge;
|
||||
private readonly BeatmapInfoWedge beatmapInfoWedge;
|
||||
|
||||
protected Container LeftContent;
|
||||
|
||||
|
Reference in New Issue
Block a user