public ShipMovementInfoChange(ShipMovementInfoChange copy)
 {
     this.MaxAngularAcceleration = copy.MaxAngularAcceleration;
     this.MaxAngularVelocity     = copy.MaxAngularVelocity;
     this.MaxLinearAcceleration  = copy.MaxLinearAcceleration;
     this.MaxLinearVelocity      = copy.MaxLinearVelocity;
 }
 public void ChangeLeftOver(ShipMovementInfoChange change)
 {
     change.MaxAngularAcceleration = this.MaxAngularAcceleration.ChangeValue(change.MaxAngularAcceleration);
     change.MaxAngularVelocity     = this.MaxAngularVelocity.ChangeValue(change.MaxAngularVelocity);
     change.MaxLinearAcceleration  = this.MaxLinearAcceleration.ChangeValue(change.MaxLinearAcceleration);
     change.MaxLinearVelocity      = this.MaxLinearVelocity.ChangeValue(change.MaxLinearVelocity);
 }
 public void Change(ShipMovementInfoChange change)
 {
     this.MaxAngularAcceleration.Value += change.MaxAngularAcceleration;
     this.MaxAngularVelocity.Value     += change.MaxAngularVelocity;
     this.MaxLinearAcceleration.Value  += change.MaxLinearAcceleration;
     this.MaxLinearVelocity.Value      += change.MaxLinearVelocity;
 }
        public ShipMovementInfoChange RemoveEffectTypes(EffectTypes types)
        {
            ShipMovementInfoChange removed = new ShipMovementInfoChange();

            if ((types & EffectTypes.MaxAngularAcceleration) == EffectTypes.MaxAngularAcceleration)
            {
                removed.MaxAngularAcceleration = MaxAngularAcceleration;
                this.MaxAngularAcceleration    = 0;
            }
            if ((types & EffectTypes.MaxAngularVelocity) == EffectTypes.MaxAngularVelocity)
            {
                removed.MaxAngularVelocity = MaxAngularVelocity;
                this.MaxAngularVelocity    = 0;
            }
            if ((types & EffectTypes.MaxLinearAcceleration) == EffectTypes.MaxLinearAcceleration)
            {
                removed.MaxLinearAcceleration = MaxLinearAcceleration;
                this.MaxLinearAcceleration    = 0;
            }
            if ((types & EffectTypes.MaxLinearVelocity) == EffectTypes.MaxLinearVelocity)
            {
                removed.MaxLinearVelocity = MaxLinearVelocity;
                this.MaxLinearVelocity    = 0;
            }
            return(removed);
        }
 public void Merge(ShipMovementInfoChange other)
 {
     this.MaxAngularAcceleration = this.MaxAngularAcceleration + other.MaxAngularAcceleration;
     this.MaxAngularVelocity     = this.MaxAngularVelocity + other.MaxAngularVelocity;
     this.MaxLinearAcceleration  = this.MaxLinearAcceleration + other.MaxLinearAcceleration;
     this.MaxLinearVelocity      = this.MaxLinearVelocity + other.MaxLinearVelocity;
 }
        public static ShipMovementInfoChange Merge(ShipMovementInfoChange first, ShipMovementInfoChange second)
        {
            ShipMovementInfoChange returnvalue = new ShipMovementInfoChange();

            returnvalue.MaxAngularAcceleration = first.MaxAngularAcceleration + second.MaxAngularAcceleration;
            returnvalue.MaxAngularVelocity     = first.MaxAngularVelocity + second.MaxAngularVelocity;
            returnvalue.MaxLinearAcceleration  = first.MaxLinearAcceleration + second.MaxLinearAcceleration;
            returnvalue.MaxLinearVelocity      = first.MaxLinearVelocity + second.MaxLinearVelocity;
            return(returnvalue);
        }
 public void Merge(GeneralChange other)
 {
     if (other != null)
     {
         if (other.MovementInfoChange != null)
         {
             if (MovementInfoChange == null)
             {
                 MovementInfoChange = other.MovementInfoChange;
             }
             else
             {
                 MovementInfoChange.Merge(other.MovementInfoChange);
             }
         }
         if (other.ShipStateChange != null)
         {
             if (ShipStateChange == null)
             {
                 ShipStateChange = other.ShipStateChange;
             }
             else
             {
                 ShipStateChange.Merge(other.ShipStateChange);
             }
         }
         if (other.PhysicsChange != null)
         {
             if (PhysicsChange == null)
             {
                 PhysicsChange = other.PhysicsChange;
             }
             else
             {
                 PhysicsChange.Velocity         += other.PhysicsChange.Velocity;
                 PhysicsChange.Position         += other.PhysicsChange.Position;
                 PhysicsChange.ForceAccumulator += other.PhysicsChange.ForceAccumulator;
                 PhysicsChange.Acceleration     += other.PhysicsChange.Acceleration;
             }
         }
     }
 }
        public static EffectTypes CalcHarmfulEffectTypes(ShipMovementInfoChange ssc)
        {
            EffectTypes returnvalue = EffectTypes.None;

            if (ssc.MaxAngularAcceleration < 0)
            {
                returnvalue |= EffectTypes.MaxAngularAcceleration;
            }
            if (ssc.MaxAngularVelocity < 0)
            {
                returnvalue |= EffectTypes.MaxAngularVelocity;
            }
            if (ssc.MaxLinearAcceleration < 0)
            {
                returnvalue |= EffectTypes.MaxLinearAcceleration;
            }
            if (ssc.MaxLinearVelocity < 0)
            {
                returnvalue |= EffectTypes.MaxLinearVelocity;
            }
            return(returnvalue);
        }