예제 #1
0
        public void Load(ConfigNode node)
        {
            radiationEnabled = true;
            if (node.HasValue("radiationEnabled"))
            {
                Boolean.TryParse(node.GetValue("radiationEnabled"), out radiationEnabled);
            }
            ConfigNode solarNode = node.GetNode("solar");

            if (solarNode != null)
            {
                mSolar.OnLoad(solarNode);
            }
            mVessels.Clear();
            mKerbals.Clear();
            foreach (ConfigNode ktNode in node.GetNodes("kerbalTracker"))
            {
                if (ktNode.HasValue("name"))
                {
                    string name = ktNode.GetValue("name");
                    Logging.Log("Loading " + name);
                    KerbalTracker kt = new KerbalTracker(name);
                    kt.OnLoad(ktNode);
                    mKerbals.Add(name, kt);
                }
                else
                {
                    Logging.Log(String.Format("No name found in kerbalTracker {0}", ktNode.ToString()));
                }
            }
            Logging.Log("KappaRay Core loaded successfully.");
        }
예제 #2
0
 public KerbalTracker getKTbyName(string name)
 {
     if (!mKerbals.ContainsKey(name))
     {
         mKerbals[name] = new KerbalTracker(name);
     }
     return(mKerbals[name]);
 }
예제 #3
0
 private void updateTrackedKerbals()
 {
     mTracked = new Dictionary <Vessel, List <KerbalTracker> >();
     mTracked.Add(EmptyVessel, new List <KerbalTracker>());
     foreach (KerbalTracker kt in mKerbals.Values)
     {
         mTracked[EmptyVessel].Add(kt);
     }
     foreach (Vessel v in mVessels.Keys)
     {
         mTracked.Add(v, new List <KerbalTracker>());
         foreach (ProtoCrewMember cm in v.GetVesselCrew())
         {
             KerbalTracker kt = getKT(cm);
             if (mTracked[EmptyVessel].Contains(kt))
             {
                 mTracked[EmptyVessel].Remove(kt);
             }
             mTracked[v].Add(kt);
         }
     }
 }
예제 #4
0
 public void ForgetKerbal(KerbalTracker kt)
 {
     mKerbals.Remove(kt.name);
 }
예제 #5
0
파일: Core.cs 프로젝트: kjoenth/kpu_mod
 public void Load(ConfigNode node)
 {
     radiationEnabled = true;
     if (node.HasValue("radiationEnabled"))
         Boolean.TryParse(node.GetValue("radiationEnabled"), out radiationEnabled);
     ConfigNode solarNode = node.GetNode("solar");
     if (solarNode != null)
         mSolar.OnLoad(solarNode);
     mVessels.Clear();
     mKerbals.Clear();
     foreach (ConfigNode ktNode in node.GetNodes("kerbalTracker"))
     {
         if (ktNode.HasValue("name"))
         {
             string name = ktNode.GetValue("name");
             Logging.Log("Loading " + name);
             KerbalTracker kt = new KerbalTracker(name);
             kt.OnLoad(ktNode);
             mKerbals.Add(name, kt);
         }
         else
         {
             Logging.Log(String.Format("No name found in kerbalTracker {0}", ktNode.ToString()));
         }
     }
     Logging.Log("KappaRay Core loaded successfully.");
 }
예제 #6
0
파일: Core.cs 프로젝트: kjoenth/kpu_mod
 public KerbalTracker getKTbyName(string name)
 {
     if (!mKerbals.ContainsKey(name))
         mKerbals[name] = new KerbalTracker(name);
     return mKerbals[name];
 }
예제 #7
0
파일: Core.cs 프로젝트: kjoenth/kpu_mod
 public void ForgetKerbal(KerbalTracker kt)
 {
     mKerbals.Remove(kt.name);
 }