Example #1
0
        private void createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false)
        {
            Clear();

            var inputManager = new ManiaInputManager(maniaRuleset, cols)
            {
                RelativeSizeAxes = Axes.Both
            };

            Add(inputManager);

            ManiaPlayfield playfield;

            inputManager.Add(playfield = new ManiaPlayfield(cols)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                SpecialColumnPosition = specialPos
            });

            playfield.Inverted.Value = inverted;
        }
Example #2
0
        private ManiaPlayfield createPlayfield(List <StageDefinition> stages, bool inverted = false)
        {
            Clear();

            var inputManager = new ManiaInputManager(maniaRuleset, stages.Sum(g => g.Columns))
            {
                RelativeSizeAxes = Axes.Both
            };

            Add(inputManager);

            ManiaPlayfield playfield;

            inputManager.Add(playfield = new ManiaPlayfield(stages)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
            });

            playfield.Inverted.Value = inverted;

            return(playfield);
        }
Example #3
0
        private void createPlayfieldWithNotes(bool inverted = false)
        {
            Clear();

            var rateAdjustClock = new StopwatchClock(true)
            {
                Rate = 1
            };

            var inputManager = new ManiaInputManager(maniaRuleset, 4)
            {
                RelativeSizeAxes = Axes.Both
            };

            Add(inputManager);

            ManiaPlayfield playfield;
            var            stages = new List <StageDefinition>
            {
                new StageDefinition {
                    Columns = 4
                },
            };

            inputManager.Add(playfield = new ManiaPlayfield(stages)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Clock  = new FramedClock(rateAdjustClock)
            });

            playfield.Inverted.Value = inverted;

            for (double t = start_time; t <= start_time + duration; t += 100)
            {
                var note1 = new Note {
                    StartTime = t, Column = 0
                };
                var note2 = new Note {
                    StartTime = t, Column = 3
                };

                note1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
                note2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                playfield.Add(new DrawableNote(note1, ManiaAction.Key1));
                playfield.Add(new DrawableNote(note2, ManiaAction.Key4));
            }

            var holdNote1 = new HoldNote {
                StartTime = start_time, Duration = duration, Column = 1
            };
            var holdNote2 = new HoldNote {
                StartTime = start_time, Duration = duration, Column = 2
            };

            holdNote1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
            holdNote2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            playfield.Add(new DrawableHoldNote(holdNote1, ManiaAction.Key2));
            playfield.Add(new DrawableHoldNote(holdNote2, ManiaAction.Key3));
        }
Example #4
0
        private void createPlayfieldWithNotes(bool gravity, bool inverted = false)
        {
            Clear();

            var rateAdjustClock = new StopwatchClock(true)
            {
                Rate = 1
            };

            var inputManager = new ManiaInputManager(maniaRuleset, 4)
            {
                RelativeSizeAxes = Axes.Both
            };

            Add(inputManager);

            ManiaPlayfield playfield;

            inputManager.Add(playfield = new ManiaPlayfield(4)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Clock  = new FramedClock(rateAdjustClock)
            });

            playfield.Inverted.Value = inverted;

            if (!gravity)
            {
                playfield.Columns.ForEach(c => c.Add(createTimingChange(0, false)));
            }

            for (double t = start_time; t <= start_time + duration; t += 100)
            {
                if (gravity)
                {
                    playfield.Columns.ElementAt(0).Add(createTimingChange(t, true));
                }

                playfield.Add(new DrawableNote(new Note
                {
                    StartTime = t,
                    Column    = 0
                }, ManiaAction.Key1));

                if (gravity)
                {
                    playfield.Columns.ElementAt(3).Add(createTimingChange(t, true));
                }

                playfield.Add(new DrawableNote(new Note
                {
                    StartTime = t,
                    Column    = 3
                }, ManiaAction.Key4));
            }

            if (gravity)
            {
                playfield.Columns.ElementAt(1).Add(createTimingChange(start_time, true));
            }

            playfield.Add(new DrawableHoldNote(new HoldNote
            {
                StartTime = start_time,
                Duration  = duration,
                Column    = 1
            }, ManiaAction.Key2));

            if (gravity)
            {
                playfield.Columns.ElementAt(2).Add(createTimingChange(start_time, true));
            }

            playfield.Add(new DrawableHoldNote(new HoldNote
            {
                StartTime = start_time,
                Duration  = duration,
                Column    = 2
            }, ManiaAction.Key3));
        }