Example #1
0
        public double ModifyFlightDataForScope(double modifier, String scope, bool additive)
        {
            if (flightData == null)
            {
                return(0);
            }

            FlightDataBody bodyData = flightData.GetFlightData(scope);

            if (bodyData == null)
            {
                if (!additive)
                {
                    return(0);
                }
                modifier = ApplyFlightDataMultiplier(modifier);

                if (modifier >= dataCap)
                {
                    modifier = dataCap;
                }

                flightData.AddFlightData(scope, modifier, 0);
                return(modifier);
            }

            if (additive)
            {
                modifier             = ApplyFlightDataMultiplier(modifier);
                bodyData.flightData += modifier;
            }
            else
            {
                bodyData.flightData *= modifier;
            }

            if (bodyData.flightData >= dataCap)
            {
                bodyData.flightData = dataCap;
            }

            flightData.AddFlightData(scope, bodyData.flightData, bodyData.flightTime);
            return(bodyData.flightData);
        }
Example #2
0
 public void InitializeFlightData(List <TestFlightData> allFlightData)
 {
     if (allFlightData == null)
     {
         allFlightData = AttemptTechTransfer();
     }
     if (allFlightData == null)
     {
         return;
     }
     baseFlightData = new FlightDataConfig();
     flightData     = new FlightDataConfig();
     foreach (TestFlightData data in allFlightData)
     {
         baseFlightData.AddFlightData(data.scope, data.flightData, data.flightTime);
         flightData.AddFlightData(data.scope, data.flightData, data.flightTime);
     }
     missionStartTime = 0;
     return;
 }