1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Make more things private

This commit is contained in:
Dean Herbert 2017-12-18 11:13:16 +09:00
parent d6ba53acb3
commit b21c22085d
2 changed files with 16 additions and 16 deletions

View File

@ -28,9 +28,9 @@ namespace osu.Game.Screens.Select.Carousel
private Sprite background;
public Action<BeatmapInfo> StartRequested;
public Action<BeatmapInfo> EditRequested;
public Action<BeatmapInfo> HideRequested;
private Action<BeatmapInfo> startRequested;
private Action<BeatmapInfo> editRequested;
private Action<BeatmapInfo> hideRequested;
private Triangles triangles;
private StarCounter starCounter;
@ -46,12 +46,12 @@ namespace osu.Game.Screens.Select.Carousel
{
if (songSelect != null)
{
StartRequested = songSelect.Start;
EditRequested = songSelect.Edit;
startRequested = songSelect.Start;
editRequested = songSelect.Edit;
}
if (manager != null)
HideRequested = manager.Hide;
hideRequested = manager.Hide;
Children = new Drawable[]
{
@ -153,7 +153,7 @@ namespace osu.Game.Screens.Select.Carousel
protected override bool OnClick(InputState state)
{
if (Item.State == CarouselItemState.Selected)
StartRequested?.Invoke(beatmap);
startRequested?.Invoke(beatmap);
return base.OnClick(state);
}
@ -168,9 +168,9 @@ namespace osu.Game.Screens.Select.Carousel
public MenuItem[] ContextMenuItems => new MenuItem[]
{
new OsuMenuItem("Play", MenuItemType.Highlighted, () => StartRequested?.Invoke(beatmap)),
new OsuMenuItem("Edit", MenuItemType.Standard, () => EditRequested?.Invoke(beatmap)),
new OsuMenuItem("Hide", MenuItemType.Destructive, () => HideRequested?.Invoke(beatmap)),
new OsuMenuItem("Play", MenuItemType.Highlighted, () => startRequested?.Invoke(beatmap)),
new OsuMenuItem("Edit", MenuItemType.Standard, () => editRequested?.Invoke(beatmap)),
new OsuMenuItem("Hide", MenuItemType.Destructive, () => hideRequested?.Invoke(beatmap)),
};
}
}

View File

@ -24,8 +24,8 @@ namespace osu.Game.Screens.Select.Carousel
{
public class DrawableCarouselBeatmapSet : DrawableCarouselItem, IHasContextMenu
{
public Action<BeatmapSetInfo> DeleteRequested;
public Action<BeatmapSetInfo> RestoreHiddenRequested;
private Action<BeatmapSetInfo> deleteRequested;
private Action<BeatmapSetInfo> restoreHiddenRequested;
private readonly BeatmapSetInfo beatmapSet;
@ -43,8 +43,8 @@ namespace osu.Game.Screens.Select.Carousel
if (localisation == null)
throw new ArgumentNullException(nameof(localisation));
RestoreHiddenRequested = s => s.Beatmaps.ForEach(manager.Restore);
DeleteRequested = manager.Delete;
restoreHiddenRequested = s => s.Beatmaps.ForEach(manager.Restore);
deleteRequested = manager.Delete;
Children = new Drawable[]
{
@ -97,9 +97,9 @@ namespace osu.Game.Screens.Select.Carousel
items.Add(new OsuMenuItem("Expand", MenuItemType.Highlighted, () => Item.State.Value = CarouselItemState.Selected));
if (beatmapSet.Beatmaps.Any(b => b.Hidden))
items.Add(new OsuMenuItem("Restore all hidden", MenuItemType.Standard, () => RestoreHiddenRequested?.Invoke(beatmapSet)));
items.Add(new OsuMenuItem("Restore all hidden", MenuItemType.Standard, () => restoreHiddenRequested?.Invoke(beatmapSet)));
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => DeleteRequested?.Invoke(beatmapSet)));
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => deleteRequested?.Invoke(beatmapSet)));
return items.ToArray();
}