Exemplo n.º 1
0
        public void _0_Sets_Image_With_0_Fill_To_0_Fill()
        {
            m_image.fillAmount = 0;
            m_HeartContainer.Replenish(0);

            Assert.AreEqual(0, m_image.fillAmount);
        }
Exemplo n.º 2
0
 private void Start()
 {
     _heartContainer           = new HeartContainer(_images.Select(image => new Heart(image)).ToList());
     _score                    = playerController.scoreObj;
     playerController.Healed  += (sender, args) => _heartContainer.Replenish(args.Amount);
     playerController.Damaged += (sender, args) => _heartContainer.Deplate(args.Amount);
     playerController.Scored  += (sender, args) => _score.AddScore(args.Amount);
 }
Exemplo n.º 3
0
    private void Start()
    {
        _player         = new Player(20, 20);
        _heartContainer = new HeartContainer(
            _images.Select(image => new Heart(image)).ToList());

        _player.Healed  += (sender, args) => _heartContainer.Replenish(args.Amount);
        _player.Damaged += (sender, args) => _heartContainer.Deplete(args.Amount);
    }
Exemplo n.º 4
0
        public void _1_Sets_Image_With_0_Fill_To_25_Percent_Fill()
        {
            Target.fillAmount = 0;

            var heartContainer = new HeartContainer(new List <Heart> {
                _heart
            });

            heartContainer.Replenish(1);

            Assert.AreEqual(0.25f, Target.fillAmount);
        }
Exemplo n.º 5
0
        public void _3_Hearts_Are_Replenished_In_Order()
        {
            Target.fillAmount = 0;
            var image = new GameObject().AddComponent <Image>();

            image.fillAmount = 0;
            var heartContainer = new HeartContainer(new List <Heart> {
                new Heart(image), new Heart(Target)
            });

            heartContainer.Replenish(1);

            Assert.AreEqual(0, Target.fillAmount);
        }