Ejemplo n.º 1
0
        private static Texture getAnimationFrame(ISkin skin, TaikoMascotAnimationState state, int frameIndex)
        {
            var texture = skin.GetTexture($"pippidon{state.ToString().ToLower()}{frameIndex}");

            if (frameIndex == 0 && texture == null)
            {
                texture = skin.GetTexture($"pippidon{state.ToString().ToLower()}");
            }

            return(texture);
        }
Ejemplo n.º 2
0
        private void assertStateAfterResult(JudgementResult judgementResult, TaikoMascotAnimationState expectedState)
        {
            AddStep($"{judgementResult.Type.ToString().ToLower()} result for {judgementResult.Judgement.GetType().Name.Humanize(LetterCasing.LowerCase)}",
                    () => applyNewResult(judgementResult));

            AddAssert($"state is {expectedState.ToString().ToLower()}", () => allMascotsIn(expectedState));
        }
Ejemplo n.º 3
0
        public void TestClearStateOnClearedSwell(bool kiai, TaikoMascotAnimationState expectedStateAfterClear)
        {
            AddStep("set beatmap", () => setBeatmap(kiai));

            createDrawableRuleset();

            assertStateAfterResult(new JudgementResult(new Swell(), new TaikoSwellJudgement())
            {
                Type = HitResult.Great
            }, TaikoMascotAnimationState.Clear);
            AddUntilStep($"state reverts to {expectedStateAfterClear.ToString().ToLower()}", () => allMascotsIn(expectedStateAfterClear));
        }
        private void assertStateAfterResult(JudgementResult judgementResult, TaikoMascotAnimationState expectedState)
        {
            TaikoMascotAnimationState[] mascotStates = null;

            AddStep($"{judgementResult.Type.ToString().ToLower()} result for {judgementResult.Judgement.GetType().Name.Humanize(LetterCasing.LowerCase)}",
                    () =>
            {
                applyNewResult(judgementResult);
                // store the states as soon as possible, so that the delay between steps doesn't incorrectly fail the test
                // due to not checking if the state changed quickly enough.
                Schedule(() => mascotStates = animatedMascots.Select(mascot => mascot.State.Value).ToArray());
            });

            AddAssert($"state is {expectedState.ToString().ToLower()}", () => mascotStates.All(state => state == expectedState));
        }
Ejemplo n.º 5
0
 private static Texture getAnimationFrame(ISkin skin, TaikoMascotAnimationState state, int frameIndex)
 => skin.GetTexture($"pippidon{state.ToString().ToLower()}{frameIndex}");