Esempio n. 1
0
        public void _CAN_CREATE()
        {
            BombColors bc = new BombColors(new Dictionary <Color, float>()
            {
                { Color.red, 1f }, { Color.blue, 1f }
            });

            Assert.NotNull(bc);
        }
Esempio n. 2
0
        public void _THRUST_NaN()
        {
            BombColors bc =
                new BombColors(new Dictionary <Color, float>()
            {
                { Color.red, 0f }, { Color.blue, 0f }, { Color.green, 0f }
            });

            Assert.AreEqual(Color.black, bc.CurrentColorValue);
            Assert.AreEqual(0, bc.CurrentThrust);
        }
Esempio n. 3
0
        public void _THRUST_WHITE()
        {
            BombColors bc =
                new BombColors(new Dictionary <Color, float>()
            {
                { Color.red, 1f }, { Color.blue, 1f }, { Color.green, 1f }
            });

            Assert.AreEqual(Color.white, bc.CurrentColorValue);
            Assert.AreEqual(3f, bc.CurrentThrust, 0.0001);
        }
Esempio n. 4
0
        public void _THRUST_EVENT()
        {
            BombColors bc =
                new BombColors(new Dictionary <Color, float>()
            {
                { Color.red, 1f }, { Color.blue, 1f }, { Color.green, 1f }
            });
            int test = 0;

            bc.OnEmpty += (sender, args) => { test = 1; };
            for (int i = 0; i < 100; i++)
            {
                bc.DecreaseAll(0.1f);
            }
            Assert.AreEqual(1, test);
        }
    public void Fire()
    {
        onFire?.Invoke();
        thrust.Play();
        _rigidbody2D.isKinematic = false;
        GetAmounts();
        Dictionary <Color, float> temp = new Dictionary <Color, float>()
        {
            { Color.cyan, _cyan },
            { Color.magenta, _magenta },
            { Color.yellow, _yellow }
        };

        _bombColors          = new BombColors(temp);
        _bombColors.OnEmpty += OnEmpty;
        isFired              = true;
    }