<commit_before>// Copyright (c) p<NAME> Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Testing;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Catch.Skinning;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Catch.Tests
{
    public class TestSceneHyperDashColouring : OsuTestScene
    {
        [TestCase(false)]
        [TestCase(true)]
        public void TestHyperDashFruitColour(bool legacyFruit)
        {
            DrawableFruit drawableFruit = null;<commit_msg>Add hyper-dash catcher & trails colouring test cases<commit_after>// Copyright (c) <NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Testing;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Catch.Skinning;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Catch.Tests
{
    public class TestSceneHyperDashColouring : OsuTestScene
    {
        [Test]
        public void TestHyperDashCatcherColour()
        {
            CatcherArea catcherArea = null;

            AddStep("setup catcher", () =>
            {
                Child = setupSkinHierarchy(() =>
                    catcherArea = new CatcherArea
                    {
                        RelativePositionAxes = Axes.None,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Scale = new Vector2(4f),
                    }, false);
            });

            AddStep("set hyper-dash", () =>
            {
                catcherArea.MovableCatcher.SetHyperDashState(2);
                catcherArea.MovableCatcher.FinishTransforms();
            });

            AddAssert("catcher colour default-hyperdash", () => catcherArea.MovableCatcher.Colour == Color4.OrangeRed);
            AddAssert("catcher trails colour default-hyperdash", () => catcherArea.OfType<Container<CatcherTrailSprite>>().Any(c => c.Colour == Catcher.DefaultHyperDashColour));

            AddStep("clear hyper-dash", () =>
            {
                catcherArea.MovableCatcher.SetHyperDashState(1);
                catcherArea.MovableCatcher.FinishTransforms();
            });

            AddAssert("catcher colour white", () => catcherArea.MovableCatcher.Colour == Color4.White);
        }

        [Test]
        public void TestCustomHyperDashCatcherColour()
        {
            CatcherArea catcherArea = null;

            AddStep("setup catcher", () =>
            {
                Child = setupSkinHierarchy(() =>
                    catcherArea = new CatcherArea
                    {
                        RelativePositionAxes = Axes.None,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Scale = new Vector2(4f),
                    }, true);
            });

            AddStep("set hyper-dash", () =>
            {
                catcherArea.MovableCatcher.SetHyperDashState(2);
                catcherArea.MovableCatcher.FinishTransforms();
            });

            AddAssert("catcher colour custom-hyperdash", () => catcherArea.MovableCatcher.Colour == TestLegacySkin.CustomHyperDashColour);
            AddAssert("catcher trails colour custom-hyperdash", () => catcherArea.OfType<Container<CatcherTrailSprite>>().Any(c => c.Colour == TestLegacySkin.CustomHyperDashColour));

            AddStep("clear hyper-dash", () =>
            {
                catcherArea.MovableCatcher.SetHyperDashState(1);
                catcherArea.MovableCatcher.FinishTransforms();
            });

            AddAssert("catcher colour white", () => catcherArea.MovableCatcher.Colour == Color4.White);
        }

        [Test]
        public void TestHyperDashCatcherEndGlowColour()
        {
            CatcherArea catcherArea = null;

            AddStep("setup catcher", () =>
            {
                Child = setupSkinHierarchy(() =>
                    catcherArea = new CatcherArea
                    {
                        RelativePositionAxes = Axes.None,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Scale = new Vector2(4f),
                    }, false, false, false);
            });

            AddStep("set hyper-dash", () => catcherArea.MovableCatcher.SetHyperDashState(2));
            AddAssert("end-glow sprite colour default-hyperdash", () => catcherArea.OfType<Container<CatcherTrailSprite>>().Any(c => c.Colour == Catcher.DefaultHyperDashColour));
        }

        [TestCase(true)]
        [TestCase(false)]
        public void TestCustomHyperDashCatcherEndGlowColour(bool customHyperDashCatcherColour)
        {
            CatcherArea catcherArea = null;

            AddStep("setup catcher", () =>
            {
                Child = setupSkinHierarchy(() =>
                    catcherArea = new CatcherArea
                    {
                        RelativePositionAxes = Axes.None,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Scale = new Vector2(4f),
                    }, customHyperDashCatcherColour, false, true);
            });

            AddStep("set hyper-dash", () => catcherArea.MovableCatcher.SetHyperDashState(2));
            AddAssert("end-glow sprite colour custom-hyperdash", () => catcherArea.OfType<Container<CatcherTrailSprite>>().Any(c => c.Colour == TestLegacySkin.CustomHyperDashAfterColour));
        }

        [Test]
        public void TestCustomHyperDashCatcherEndGlowColourFallback()
        {
            CatcherArea catcherArea = null;

            AddStep("setup catcher", () =>
            {
                Child = setupSkinHierarchy(() =>
                    catcherArea = new CatcherArea
                    {
                        RelativePositionAxes = Axes.None,
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Scale = new Vector2(4f),
                    }, true, false, false);
            });

            AddStep("set hyper-dash", () => catcherArea.MovableCatcher.SetHyperDashState(2));
            AddAssert("end-glow sprite colour catcher-custom-hyperdash", () => catcherArea.OfType<Container<CatcherTrailSprite>>().Any(c => c.Colour == TestLegacySkin.CustomHyperDashColour));
        }

        [TestCase(false)]
        [TestCase(true)]
        public void TestHyperDashFruitColour(bool legacyFruit)
        {
            DrawableFruit drawableFruit = null;
{'fraction_non_alphanumeric': 0.10376017573329888, 'fraction_numerical': 0.002584313218762114, 'mean_word_length': 2.0329153605015673, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 50, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4938123', 'n_tokens_mistral': 2314, 'n_tokens_neox': 2131, 'n_words': 376}