Ejemplo n.º 1
0
        public BeatmapGroup(BeatmapSetInfo beatmapSet, BeatmapDatabase database)
        {
            BeatmapSet = beatmapSet;
            WorkingBeatmap beatmap = database.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());

            foreach (var b in BeatmapSet.Beatmaps)
            {
                b.StarDifficulty = (float)(database.GetWorkingBeatmap(b).Beatmap?.CalculateStarDifficulty() ?? -1f);
            }

            Header = new BeatmapSetHeader(beatmap)
            {
                GainedSelection  = headerGainedSelection,
                RelativeSizeAxes = Axes.X,
            };

            BeatmapSet.Beatmaps = BeatmapSet.Beatmaps.OrderBy(b => b.StarDifficulty).ToList();
            BeatmapPanels       = BeatmapSet.Beatmaps.Select(b => new BeatmapPanel(b)
            {
                Alpha            = 0,
                GainedSelection  = panelGainedSelection,
                StartRequested   = p => { StartRequested?.Invoke(p.Beatmap); },
                RelativeSizeAxes = Axes.X,
            }).ToList();

            Header.AddDifficultyIcons(BeatmapPanels);
        }
Ejemplo n.º 2
0
        public BeatmapGroup(BeatmapSetInfo beatmapSet, BeatmapManager manager)
        {
            BeatmapSet = beatmapSet;
            WorkingBeatmap beatmap = manager.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());

            Header = new BeatmapSetHeader(beatmap)
            {
                GainedSelection        = headerGainedSelection,
                DeleteRequested        = b => DeleteRequested(b),
                RestoreHiddenRequested = b => RestoreHiddenRequested(b),
                RelativeSizeAxes       = Axes.X,
            };

            BeatmapPanels = BeatmapSet.Beatmaps.Where(b => !b.Hidden).OrderBy(b => b.StarDifficulty).Select(b => new BeatmapPanel(b)
            {
                Alpha            = 0,
                GainedSelection  = panelGainedSelection,
                HideRequested    = p => HideDifficultyRequested?.Invoke(p),
                StartRequested   = p => StartRequested?.Invoke(p.Beatmap),
                EditRequested    = p => EditRequested?.Invoke(p.Beatmap),
                RelativeSizeAxes = Axes.X,
            }).ToList();

            Header.AddDifficultyIcons(BeatmapPanels);
        }
Ejemplo n.º 3
0
        private void headerGainedSelection(BeatmapSetHeader panel)
        {
            State = BeatmapGroupState.Expanded;

            //we want to make sure one of our children is selected in the case none have been selected yet.
            if (SelectedPanel == null)
            {
                BeatmapPanels.First().State = PanelSelectedState.Selected;
            }
        }
Ejemplo n.º 4
0
        public BeatmapGroup(WorkingBeatmap beatmap)
        {
            this.beatmap = beatmap;

            Header = new BeatmapSetHeader(beatmap)
            {
                GainedSelection  = headerGainedSelection,
                RelativeSizeAxes = Axes.X,
            };

            BeatmapPanels = beatmap.BeatmapSetInfo.Beatmaps.Select(b => new BeatmapPanel(b)
            {
                GainedSelection  = panelGainedSelection,
                RelativeSizeAxes = Axes.X,
            }).ToList();
        }
Ejemplo n.º 5
0
        public BeatmapGroup(WorkingBeatmap beatmap)
        {
            Header = new BeatmapSetHeader(beatmap)
            {
                GainedSelection  = headerGainedSelection,
                RelativeSizeAxes = Axes.X,
            };

            BeatmapSet    = beatmap.BeatmapSetInfo;
            BeatmapPanels = beatmap.BeatmapSetInfo.Beatmaps.Select(b => new BeatmapPanel(b)
            {
                Alpha            = 0,
                GainedSelection  = panelGainedSelection,
                StartRequested   = p => { StartRequested?.Invoke(p.Beatmap); },
                RelativeSizeAxes = Axes.X,
            }).ToList();

            Header.AddDifficultyIcons(BeatmapPanels);
        }
Ejemplo n.º 6
0
        public BeatmapGroup(BeatmapSetInfo beatmapSet, BeatmapManager manager)
        {
            BeatmapSet = beatmapSet;
            WorkingBeatmap beatmap = manager.GetWorkingBeatmap(BeatmapSet.Beatmaps.FirstOrDefault());

            Header = new BeatmapSetHeader(beatmap)
            {
                GainedSelection  = headerGainedSelection,
                RelativeSizeAxes = Axes.X,
            };

            BeatmapSet.Beatmaps = BeatmapSet.Beatmaps.OrderBy(b => b.StarDifficulty).ToList();
            BeatmapPanels       = BeatmapSet.Beatmaps.Select(b => new BeatmapPanel(b)
            {
                Alpha            = 0,
                GainedSelection  = panelGainedSelection,
                StartRequested   = p => { StartRequested?.Invoke(p.Beatmap); },
                RelativeSizeAxes = Axes.X,
            }).ToList();

            Header.AddDifficultyIcons(BeatmapPanels);
        }