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."); }
public KerbalTracker getKTbyName(string name) { if (!mKerbals.ContainsKey(name)) { mKerbals[name] = new KerbalTracker(name); } return(mKerbals[name]); }
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); } } }
public void ForgetKerbal(KerbalTracker kt) { mKerbals.Remove(kt.name); }
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."); }
public KerbalTracker getKTbyName(string name) { if (!mKerbals.ContainsKey(name)) mKerbals[name] = new KerbalTracker(name); return mKerbals[name]; }