Esempio n. 1
0
        private int getCrewTrainedLevel(ProtoCrewMember crew)
        {
            int       lastLog  = 0;
            FlightLog totalLog = crew.careerLog.CreateCopy();

            totalLog.MergeWith(crew.flightLog.CreateCopy());

            int deadFlight = -1;

            foreach (FlightLog.Entry entry in totalLog.Entries)
            {
                if (entry.flight <= deadFlight)
                {
                    continue;
                }
                if (entry.type == "Die")
                {
                    deadFlight = entry.flight;
                }
            }
            foreach (FlightLog.Entry entry in totalLog.Entries)
            {
                if (entry.flight <= deadFlight)
                {
                    continue;
                }
                if (lastLog < 1 && entry.type == "Training1")
                {
                    lastLog = 1;
                }
                if (lastLog < 2 && entry.type == "Training2")
                {
                    lastLog = 2;
                }
                if (lastLog < 3 && entry.type == "Training3")
                {
                    lastLog = 3;
                }
                if (lastLog < 4 && entry.type == "Training4")
                {
                    lastLog = 4;
                }
                if (lastLog < 5 && entry.type == "Training5")
                {
                    lastLog = 5;
                }
            }

            return(lastLog);
        }
Esempio n. 2
0
        private double getKerbalTrainingExp(ProtoCrewMember crew)
        {
            string lastExpStr = "0";

            FlightLog totalLog = crew.careerLog.CreateCopy();

            totalLog.MergeWith(crew.flightLog.CreateCopy());
            foreach (FlightLog.Entry entry in totalLog.Entries)
            {
                if (entry.type == "TrainingExp")
                {
                    lastExpStr = entry.target;
                }
            }

            return(double.Parse(lastExpStr));
        }
Esempio n. 3
0
        private double getKerbalTrainingExp(ProtoCrewMember crew)
        {
            string lastExpStr = "0";

            FlightLog totalLog = crew.careerLog.CreateCopy();

            totalLog.MergeWith(crew.flightLog.CreateCopy());

            int deadFlight = -1;

            foreach (FlightLog.Entry entry in totalLog.Entries)
            {
                if (entry.flight <= deadFlight)
                {
                    continue;
                }
                if (entry.type == "Die")
                {
                    deadFlight = entry.flight;
                }
            }

            foreach (FlightLog.Entry entry in totalLog.Entries)
            {
                if (entry.type == "TrainingExp")
                {
                    if (entry.flight <= deadFlight)
                    {
                        removeKerbalTrainingExp(crew);
                    }
                    else
                    {
                        lastExpStr = entry.target;
                    }
                }
            }

            return(double.Parse(lastExpStr));
        }