コード例 #1
0
        protected override void UpdateThrustStrength(HashSet <MyEntity> thrusters, float thrustForce)
        {
            foreach (MyEntity thrustEntity in thrusters)
            {
                var thrust = thrustEntity as MyThrust;
                if (thrust == null)
                {
                    continue;
                }

                float forceMultiplier = CalculateForceMultiplier(thrust);

                if (IsOverridden(thrust))
                {
                    thrust.CurrentStrength = forceMultiplier * thrust.ThrustOverride * ResourceSink.SuppliedRatioByType(thrust.FuelDefinition.Id) / thrust.ThrustForce.Length();
                }
                else if (IsUsed(thrust))
                {
                    thrust.CurrentStrength = forceMultiplier * thrustForce * ResourceSink.SuppliedRatioByType(thrust.FuelDefinition.Id);
                }
                else
                {
                    thrust.CurrentStrength = 0;
                }
            }
        }