Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="train"></param>
        /// <returns></returns>
        public Double GetBaseResistance(BaseTrain train)
        {
            var massRepository = MassRepository.GetInstance();
            var byMass         = massRepository.GetByMass(train.Mass);
            var modeControl    = Break1Rusi4.GetInstance(byMass);

            return(modeControl.GetBaseResistance(train));
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="velocity"></param>
 /// <param name="train"></param>
 /// <returns></returns>
 public virtual Double GetForce(Double velocity, BaseTrain train)
 {
     if (train.TimeInModeControl < train.Machine.AssemblyPullTime)
     {
         return(0.0);
     }
     return(GetForceAndCurrent(velocity, train.Mass).Item1);
 }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public Double GetBaseResistance(BaseTrain train)
        {
            var tara       = train.UnladenWeight;
            var massa      = train.Mass;
            var velocity   = train.Velocity;
            var openFactor = train.FactorOfOpenStage;

            return(GetBaseResistanceRusi4(tara, massa, velocity, openFactor));
        }
Пример #4
0
        /// <summary>获取可以锻炼的加成值</summary>
        public double GetCanAtt(tg_user user, tg_role role, int attribute, BaseTrain basetrain, int count)
        {
            count = basetrain.count * count;
            var base_rule = GetBaseRule(user, role.role_id);

            if (base_rule == null)
            {
                return(0);
            }
            var role_att = GetTrainAtt(role, attribute);
            var att      = GetAtt(role_att, count, base_rule);

            return(att);
        }
Пример #5
0
    public float HandleTrainCollision(bool front, float trackSpeed, BaseTrain theirTrain, float deltaTime, ref StaticCollisionState wasStaticColliding)
    {
        Vector3 pushDirection = (front ? base.transform.forward : (-base.transform.forward));
        float   num           = Vector3.Angle(base.transform.forward, theirTrain.transform.forward);
        float   f             = Vector3.Dot(rhs: (theirTrain.transform.position - base.transform.position).normalized, lhs: base.transform.forward);

        if ((num > 30f && num < 150f) || Mathf.Abs(f) < 0.975f)
        {
            trackSpeed = (front ? (-0.5f) : 0.5f);
        }
        else
        {
            float totalPushingMass = theirTrain.GetTotalPushingMass(pushDirection);
            trackSpeed = ((!(totalPushingMass < 0f)) ? HandleRigidbodyCollision(front, trackSpeed, theirTrain.rigidBody, totalPushingMass, deltaTime, false) : HandleStaticCollisions(true, front, trackSpeed, ref wasStaticColliding));
            float num2 = theirTrain.GetTotalPushingForces(pushDirection);
            if (!front)
            {
                num2 *= -1f;
            }
            trackSpeed += num2 / rigidBody.mass * deltaTime;
        }
        return(trackSpeed);
    }
Пример #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="velocity"></param>
 /// <returns></returns>
 public Double GetCurrent(Double velocity, BaseTrain train)
 {
     return(0);
 }
Пример #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="velocity"></param>
 /// <returns></returns>
 public Double GetForce(Double velocity, BaseTrain train)
 {
     return(0);
 }
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="velocity"></param>
 /// <param name="mass"></param>
 /// <returns></returns>
 public override Double GetForce(Double velocity, BaseTrain train)
 {
     return(GetForceAndCurrent(velocity, train.Mass).Item1);
 }
Пример #9
0
 /// <exception cref="ArgumentNullException">Значение параметра <paramref name="source" /> или <paramref name="predicate" /> — null.</exception>
 /// <exception cref="InvalidOperationException">Ни один элемент не удовлетворяет условию предиката <paramref name="predicate" />.– или –Исходная последовательность пуста.</exception>
 public virtual Double GetCurrent(Double velocity, BaseTrain train)
 {
     return(GetForceAndCurrent(velocity, train.Mass).Item2);
 }
Пример #10
0
 public bool CustomCollision(BaseTrain train, TriggerTrainCollisions trainTrigger)
 {
     return(false);
 }