Exemplo n.º 1
0
        public void TestVariousNotes()
        {
            DrawableNote     note1     = null;
            DrawableNote     note2     = null;
            DrawableHoldNote holdNote1 = null;
            DrawableHoldNote holdNote2 = null;

            AddStep("create notes", () =>
            {
                Child = new FillFlowContainer
                {
                    Clock        = new FramedClock(new ManualClock()),
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Horizontal,
                    Spacing      = new Vector2(20),
                    Children     = new[]
                    {
                        createNoteDisplay(ScrollingDirection.Down, 1, out note1),
                        createNoteDisplay(ScrollingDirection.Up, 2, out note2),
                        createHoldNoteDisplay(ScrollingDirection.Down, 1, out holdNote1),
                        createHoldNoteDisplay(ScrollingDirection.Up, 2, out holdNote2),
                    }
                };
            });

            AddAssert("note 1 facing downwards", () => verifyAnchors(note1, Anchor.y2));
            AddAssert("note 2 facing upwards", () => verifyAnchors(note2, Anchor.y0));
            AddAssert("hold note 1 facing downwards", () => verifyAnchors(holdNote1, Anchor.y2));
            AddAssert("hold note 2 facing upwards", () => verifyAnchors(holdNote2, Anchor.y0));
        }
Exemplo n.º 2
0
 public NoteSelectionBlueprint(DrawableNote note)
     : base(note)
 {
     AddInternal(new EditNotePiece {
         RelativeSizeAxes = Axes.X
     });
 }
Exemplo n.º 3
0
        public NoteMask(DrawableNote note)
            : base(note)
        {
            Scale = note.Scale;

            CornerRadius = 5;
            Masking      = true;

            AddInternal(new NotePiece());
        }
        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)
            };
        }
Exemplo n.º 5
0
        protected override void Update()
        {
            base.Update();

            // Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
            if (DrawableObject.IsLoaded)
            {
                DrawableNote note = position == HoldNotePosition.Start ? DrawableObject.Head : DrawableObject.Tail;

                Anchor = note.Anchor;
                Origin = note.Origin;

                Size     = note.DrawSize;
                Position = note.DrawPosition;
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo 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 }
                    }
                }
            });
        }
Exemplo n.º 8
0
        public TestCaseManiaPlayfield()
        {
            var rng = new Random(1337);

            AddStep("1 column", () => createPlayfield(1, SpecialColumnPosition.Normal));
            AddStep("4 columns", () => createPlayfield(4, SpecialColumnPosition.Normal));
            AddStep("Left special style", () => createPlayfield(4, SpecialColumnPosition.Left));
            AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right));
            AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal));
            AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal));
            AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left));
            AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right));
            AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true));

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

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

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

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

                playfield.OnJudgement(note, new ManiaJudgement {
                    Result = HitResult.Perfect
                });
            });
        }
Exemplo n.º 9
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
                });
            });
        }
Exemplo n.º 10
0
 public HoldNoteNoteMask(DrawableNote note)
     : base(note)
 {
     Select();
 }
Exemplo n.º 11
0
 public HoldNoteNoteSelectionBlueprint(DrawableNote note)
     : base(note)
 {
     Select();
 }
Exemplo n.º 12
0
        public TestSceneNote()
        {
            var note = new Note()
            {
                Shape = NoteShape.Circle,
                Type  = NoteType.Simple,
            };

            var dNote = new DrawableNote(note)
            {
                Origin = Anchor.Centre,
                Anchor = Anchor.Centre,
                Size   = new Vector2(64)
            };

            Add(new Box
            {
                RelativeSizeAxes = Axes.Both,
                Colour           = Colour4.White.Darken(2f)
            });

            Add(new DrawSizePreservingFillContainer
            {
                RelativeSizeAxes = Axes.Both,
                TargetDrawSize   = new Vector2(1920, 1080),
                Child            = dNote
            });

            // DrawableNote related
            AddSliderStep("Progression", 0f, 2, 1, f => dNote.Progression.Value = f);

            // Note related
            AddSliderStep("Entry angle", 0f, 360, 90, f =>
            {
                note.EntryAngle = f;
                dNote.Progression.TriggerChange();
            });

            AddSliderStep("Frequency", 0, 24, 2, f =>
            {
                note.Frequency = f;
                dNote.Progression.TriggerChange();
            });

            AddSliderStep("Amplitude", -6500f, 6500, 500, f =>
            {
                note.Amplitude = f;
                dNote.Progression.TriggerChange();
            });

            AddSliderStep("Distance", 100f, 5000, 1200, f =>
            {
                note.Distance = f;
                dNote.Progression.TriggerChange();
            });

            var animDuration = 2500D;

            AddSliderStep("Animation duration", 1000D, 10000D, 2500D, d => animDuration = d);

            AddStep("Animate", () =>
            {
                dNote.TransformBindableTo(dNote.Progression, 0).TransformBindableTo(dNote.Progression, 2f, animDuration);
            });
        }