Ejemplo n.º 1
0
        public void AddComponents_to_Scene_using_SystemComponents()
        {
            m_scene.AddComponents(new SceneUpdater(), new SceneRenderer());

            IEntity e = new GameObject();

            m_scene.Root.AddEntity(e);

            Behaviour behaviour = new Behaviour();

            bool addComponentResult = e.AddComponent(behaviour);

            Assert.IsTrue(addComponentResult);

            double       elapsedTime = 2.123;
            const double deltaTime   = 0.016;

            for (int j = 0; j < 10; j++)
            {
                m_scene.Update(elapsedTime, deltaTime);
                Assert.AreEqual(elapsedTime, m_scene.LastElapsedTime);
                Assert.AreEqual(elapsedTime, behaviour.LastElapsedTime);
                elapsedTime += deltaTime;
            }
        }