Esempio n. 1
0
        //////////////////////////////////////////////////////////////////////////////

        #region IUpdatable

        public override void Update(float delta)
        {
            base.Update(delta);

            if (IsAlive)
            {
                UpdateInput(delta);

                if (m_bombInHands != null)
                {
                    m_bombInHands.Update(delta);
                }

                m_diseases.Update(delta);
            }

            UpdateAnimation(delta);

            for (int bombIndex = 0; bombIndex < m_thrownBombs.Count; ++bombIndex)
            {
                m_thrownBombs[bombIndex].Update(delta);
            }
        }
        public void TestInfect()
        {
            List<String> result = new List<String>();
            PlayerMock player = new PlayerMock(result);

            DiseaseList list = new DiseaseList(player);

            bool infected = list.TryInfect(Diseases.MOLASSES);
            Assert.IsTrue(infected);

            infected = list.TryInfect(Diseases.MOLASSES);
            Assert.IsFalse(infected);

            AssertResult(result, Infected(Diseases.MOLASSES));

            Disease disease = DiseaseList.DiseaseForType(Diseases.MOLASSES);
            list.Update(disease.duration);

            AssertResult(result, Infected(Diseases.MOLASSES), Cured(Diseases.MOLASSES));
        }