Пример #1
0
        public TestSceneDrawableJudgement()
        {
            var hitWindows = new ManiaHitWindows();

            foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Skip(1))
            {
                if (hitWindows.IsHitResultAllowed(result))
                {
                    AddStep("Show " + result.GetDescription(), () =>
                    {
                        SetContents(_ =>
                                    new DrawableManiaJudgement(new JudgementResult(new HitObject {
                            StartTime = Time.Current
                        }, new Judgement())
                        {
                            Type = result
                        }, null)
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                        });

                        // for test purposes, undo the Y adjustment related to the `ScorePosition` legacy positioning config value
                        // (see `LegacyManiaJudgementPiece.load()`).
                        // this prevents the judgements showing somewhere below or above the bounding box of the judgement.
                        foreach (var legacyPiece in this.ChildrenOfType <LegacyManiaJudgementPiece>())
                        {
                            legacyPiece.Y = 0;
                        }
                    });
                }
            }
        }
Пример #2
0
        public TestSceneDrawableJudgement()
        {
            var hitWindows = new ManiaHitWindows();

            foreach (HitResult result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Skip(1))
            {
                if (hitWindows.IsHitResultAllowed(result))
                {
                    AddStep("Show " + result.GetDescription(), () => SetContents(() =>
                                                                                 new DrawableManiaJudgement(new JudgementResult(new HitObject(), new Judgement())
                    {
                        Type = result
                    }, null)
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                    }));
                }
            }
        }