Example #1
0
        public override Pilot Create(string[] rowData)
        {
            FlightPlan flightPlan = CreateFlightPlan(rowData);

            return(AssignGeneralData(PilotBuilder.Create(), rowData)
                   .WithRating((PilotRating)StringService.IVAO_GetInt(rowData[ClientIndex.Pilot.Version]))
                   .WithGroundSpeed(StringService.IVAO_GetInt(rowData[ClientIndex.Pilot.Groundspeed]))
                   .WithTransponderCode(rowData[ClientIndex.Pilot.TransponderCode])
                   .WithHeading(StringService.IVAO_GetInt(rowData[ClientIndex.Pilot.Heading]))
                   .WithIsOnGround(Convert.ToBoolean(Convert.ToInt16(rowData[ClientIndex.Pilot.IsOnGround])))
                   .WithFlightSimulator((FlightSimulator)StringService.IVAO_GetInt(rowData[ClientIndex.Pilot.Simulator]))
                   .WithPlaneMTL(rowData[ClientIndex.Pilot.PlaneMTL])
                   .WithFlightPlan(flightPlan)
                   .Build());
        }
Example #2
0
        public override AirTrafficController Create(string[] rowData)
        {
            if (rowData.Length == 0)
            {
                return(null);
            }

            if (rowData.Length != 49)
            {
                List <string> data = rowData.ToList();
                data.Insert(ClientIndex.UNUSED1, string.Empty);
                data.Insert(ClientIndex.UNUSED1, string.Empty);
                rowData = data.ToArray();
            }

            return(AssignGeneralData(AirTrafficControllerBuilder.Create(), rowData)
                   .WithRating((ATCRating)int.Parse(rowData[ClientIndex.ATC.Version]))
                   .WithFrequency(rowData[ClientIndex.ATC.Frequency])
                   .WithFacilityType((FacilityType)int.Parse(rowData[ClientIndex.ATC.FacilityType]))
                   .WithVisualRange(StringService.IVAO_GetInt(rowData[ClientIndex.ATC.VisualRange]))
                   .WithATIS(rowData[ClientIndex.ATC.ATIS])
                   .WithATISTime(StringService.IVAO_GetDateTime(rowData[ClientIndex.ATC.ATISTime]))
                   .Build());
        }