protected override DrawableManiaHitObject CreateHitObject()
        {
            var note = new Note();

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            return(new DrawableNote(note));
        }
Esempio n. 2
0
        private void createNote()
        {
            for (int i = 0; i < columns.Count; i++)
            {
                var obj = new Note {
                    Column = i, StartTime = Time.Current + 2000
                };
                obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                columns[i].Add(new DrawableNote(obj, columns[i].Action));
            }
        }
Esempio n. 3
0
        protected override DrawableHitObject CreateHitObject()
        {
            var note = new Note
            {
                StartTime = 100,
                Duration  = 800,
                Text      = "カラオケ"
            };

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            return(new DrawableNote(note));
        }
Esempio n. 4
0
        private void createNote()
        {
            foreach (var stage in stages)
            {
                for (int i = 0; i < stage.Columns.Count; i++)
                {
                    var obj = new Note {
                        Column = i, StartTime = Time.Current + 2000
                    };
                    obj.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                    stage.Add(new DrawableNote(obj));
                }
            }
        }
        public TestCaseNoteSelectionBlueprint()
        {
            var note = new Note {
                Column = 0
            };

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            base.Content.Child = content = new ScrollingTestContainer(ScrollingDirection.Down)
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(50, 20),
                Child  = drawableObject = new DrawableNote(note)
            };
        }
        public TestSceneNoteSelectionBlueprint()
            : base(4)
        {
            for (int i = 0; i < 4; i++)
            {
                var note = new Note
                {
                    Column    = i,
                    StartTime = i * 200,
                };
                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                var drawableHitObject = new DrawableNote(note);
                Playfield.Add(drawableHitObject);
                AddBlueprint(new NoteSelectionBlueprint(note), drawableHitObject);
            }
        }
Esempio n. 7
0
        private Drawable createNoteDisplay(ScrollingDirection direction, int identifier, out DrawableNote hitObject)
        {
            var note = new Note {
                StartTime = 0
            };

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            return(new ScrollingTestContainer(direction)
            {
                AutoSizeAxes = Axes.Both,
                Child = new NoteContainer(direction, $"note {identifier}, scrolling {direction.ToString().ToLowerInvariant()}")
                {
                    Child = hitObject = new DrawableNote(note)
                    {
                        AccentColour = { Value = Color4.OrangeRed }
                    }
                }
            });
        }
Esempio n. 8
0
        private Drawable createNoteDisplay(ScrollingDirection direction)
        {
            var note = new Note {
                StartTime = 999999999
            };

            note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

            return(new ScrollingTestContainer(direction)
            {
                AutoSizeAxes = Axes.Both,
                Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLower()}")
                {
                    Child = new DrawableNote(note, ManiaAction.Key1)
                    {
                        AccentColour = Color4.OrangeRed
                    }
                }
            });
        }
Esempio n. 9
0
        private void createNote(double increaseTime = 2000, double duration = 1000, int tone = 0, bool saiten = false)
        {
            notePlayfields.ForEach(x =>
            {
                var note = new Note
                {
                    StartTime = Time.Current + increaseTime,
                    Duration  = duration,
                    Tone      = new Tone {
                        Scale = tone
                    },
                    Text    = "Here",
                    Display = true
                };
                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                x.Add(new DrawableNote(note));
            });

            if (saiten)
            {
                createSaitenPath(increaseTime, duration, tone);
            }
        }
Esempio n. 10
0
        public TestCaseManiaPlayfield()
        {
            var rng = new Random(1337);

            AddStep("1 column", () => createPlayfield(1));
            AddStep("4 columns", () => createPlayfield(4));
            AddStep("5 columns", () => createPlayfield(5));
            AddStep("8 columns", () => createPlayfield(8));
            AddStep("4 + 4 columns", () =>
            {
                var stages = new List <StageDefinition>
                {
                    new StageDefinition {
                        Columns = 4
                    },
                    new StageDefinition {
                        Columns = 4
                    },
                };
                createPlayfield(stages);
            });

            AddStep("2 + 4 + 2 columns", () =>
            {
                var stages = new List <StageDefinition>
                {
                    new StageDefinition {
                        Columns = 2
                    },
                    new StageDefinition {
                        Columns = 4
                    },
                    new StageDefinition {
                        Columns = 2
                    },
                };
                createPlayfield(stages);
            });

            AddStep("1 + 8 + 1 columns", () =>
            {
                var stages = new List <StageDefinition>
                {
                    new StageDefinition {
                        Columns = 1
                    },
                    new StageDefinition {
                        Columns = 8
                    },
                    new StageDefinition {
                        Columns = 1
                    },
                };
                createPlayfield(stages);
            });

            AddStep("Reversed", () => createPlayfield(4, true));

            AddStep("Notes with input", () => createPlayfieldWithNotes());
            AddStep("Notes with input (reversed)", () => createPlayfieldWithNotes(true));
            AddStep("Notes with gravity", () => createPlayfieldWithNotes());
            AddStep("Notes with gravity (reversed)", () => createPlayfieldWithNotes(true));

            AddStep("Hit explosion", () =>
            {
                var playfield = createPlayfield(4);

                int col = rng.Next(0, 4);

                var note = new Note {
                    Column = col
                };
                note.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());

                var drawableNote = new DrawableNote(note, ManiaAction.Key1)
                {
                    AccentColour = playfield.Columns.ElementAt(col).AccentColour
                };

                playfield.OnJudgement(drawableNote, new ManiaJudgement {
                    Result = HitResult.Perfect
                });
                playfield.Columns[col].OnJudgement(drawableNote, new ManiaJudgement {
                    Result = HitResult.Perfect
                });
            });
        }
Esempio n. 11
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));
        }
Esempio n. 12
0
        public TestCaseManiaHitObjects()
        {
            Note     note1    = new Note();
            Note     note2    = new Note();
            HoldNote holdNote = new HoldNote {
                StartTime = 1000
            };

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

            Add(new FillFlowContainer
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Y,
                Direction        = FillDirection.Horizontal,
                Spacing          = new Vector2(10, 0),
                // Imagine that the containers containing the drawable notes are the "columns"
                Children = new Drawable[]
                {
                    new Container
                    {
                        Name             = "Normal note column",
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Y,
                        Width            = 50,
                        Children         = new[]
                        {
                            new Container
                            {
                                Name              = "Timing section",
                                RelativeSizeAxes  = Axes.Both,
                                RelativeChildSize = new Vector2(1, 10000),
                                Children          = new[]
                                {
                                    new DrawableNote(note1, ManiaAction.Key1)
                                    {
                                        Y             = 5000,
                                        LifetimeStart = double.MinValue,
                                        LifetimeEnd   = double.MaxValue,
                                        AccentColour  = Color4.Red
                                    },
                                    new DrawableNote(note2, ManiaAction.Key1)
                                    {
                                        Y             = 6000,
                                        LifetimeStart = double.MinValue,
                                        LifetimeEnd   = double.MaxValue,
                                        AccentColour  = Color4.Red
                                    }
                                }
                            }
                        }
                    },
                    new Container
                    {
                        Name             = "Hold note column",
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Y,
                        Width            = 50,
                        Children         = new[]
                        {
                            new Container
                            {
                                Name              = "Timing section",
                                RelativeSizeAxes  = Axes.Both,
                                RelativeChildSize = new Vector2(1, 10000),
                                Children          = new[]
                                {
                                    new DrawableHoldNote(holdNote, ManiaAction.Key1)
                                    {
                                        Y             = 5000,
                                        Height        = 1000,
                                        LifetimeStart = double.MinValue,
                                        LifetimeEnd   = double.MaxValue,
                                        AccentColour  = Color4.Red,
                                    }
                                }
                            }
                        }
                    }
                }
            });
        }