Ejemplo n.º 1
0
        public void TestOverallCar()
        {
            _overallCar.Calculate();
            _overallCar.StoreResult();

            Assert.IsTrue(OverallCarOutput.LastCalculation.Direction.Equals(new Vector3(1, 0, 0), 1e-5f));
            Assert.AreEqual(10.2f, OverallCarOutput.LastCalculation.Speed);
            Assert.IsTrue(OverallCarOutput.LastCalculation.Position.Equals(new Vector3(10.2f, 0, 0), 1e-5f));
        }
        /// <summary>
        /// this function is used to call all the calculate functions which runs once
        /// </summary>
        private void DoWork()
        {
            Aerodynamic.Calculate();
            Aerodynamic.StoreResult();
            Brake.Calculate();
            Brake.StoreResult();
            Engine.Calculate();
            Engine.StoreResult();
            GearBox.Calculate();
            GearBox.StoreResult();
            SecondaryDrive.Calculate();
            SecondaryDrive.StoreResult();
            Steering.Calculate();
            Steering.StoreResult();

            DoIterativeWork();

            //call the CalculateBackwards functions
            Aerodynamic.CalculateBackwards();
            Aerodynamic.StoreResult();
            Brake.CalculateBackwards();
            Brake.StoreResult();
            Engine.CalculateBackwards();
            Engine.StoreResult();
            GearBox.CalculateBackwards();
            GearBox.StoreResult();
            SecondaryDrive.CalculateBackwards();
            SecondaryDrive.StoreResult();
            Steering.CalculateBackwards();
            Steering.StoreResult();
            Track.Instance.CalculateBackwards();
            Track.Instance.StoreResult();
            Wheels.CalculateBackwards();
            Wheels.StoreResult();
            OverallCar.CalculateBackwards();
            OverallCar.StoreResult();
            Suspension.CalculateBackwards();
            Suspension.StoreResult();
        }