public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { Vessel = v; Powered = ppms.GetBool("IsRTPowered"); // get the crew count from the vessel var crewcount = v.GetVesselCrew().Count; // when the crew count is equal to 0 then look into the protoVessel if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null) crewcount = v.protoVessel.GetVesselCrew().Count; RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount); int ppmsMinCrew; //try to get the RTCommandMinCrew value in the ProtoPartModuleSnapshot if (ppms.GetInt("RTCommandMinCrew", out ppmsMinCrew)) { IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppmsMinCrew; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})", Powered, v.HasCommandStation(), crewcount, ppmsMinCrew); } else { // there was no RTCommandMinCrew member in the ProtoPartModuleSnapshot IsCommandStation = false; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), crewcount); } }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { mVessel = v; Powered = ppms.GetBool("IsRTPowered"); IsCommandStation = Powered && v.HasCommandStation() && v.GetVesselCrew().Count >= 6; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), v.GetVesselCrew().Count); }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { Vessel = v; Powered = ppms.GetBool("IsRTPowered"); // get the crew count from the vessel var crewcount = v.GetVesselCrew().Count; // when the crew count is equal to 0 then look into the protoVessel if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null) { crewcount = v.protoVessel.GetVesselCrew().Count; } RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount); int ppmsMinCrew; //try to get the RTCommandMinCrew value in the ProtoPartModuleSnapshot if (ppms.GetInt("RTCommandMinCrew", out ppmsMinCrew)) { IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppmsMinCrew; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})", Powered, v.HasCommandStation(), crewcount, ppmsMinCrew); } else { // there was no RTCommandMinCrew member in the ProtoPartModuleSnapshot IsCommandStation = false; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), crewcount); } }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { mVessel = v; Powered = ppms.GetBool("IsRTPowered"); // get the crew count from the vessel int crewcount = v.GetVesselCrew().Count; // when the crewcount is eq 0 than look into the protoVessel if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null) { crewcount = v.protoVessel.GetVesselCrew().Count; } RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount); try { IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppms.GetInt("RTCommandMinCrew"); RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})", Powered, v.HasCommandStation(), crewcount, ppms.GetInt("RTCommandMinCrew")); } catch (ArgumentException argexeception) { // I'm assuming this would get thrown by ppms.GetInt()... do the other functions have an exception spec? IsCommandStation = false; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), crewcount); RTLog.Notify("ProtoSignalProcessor ", argexeception); } }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { mVessel = v; Powered = ppms.GetBool("IsRTPowered"); // get the crew count from the vessel int crewcount = v.GetVesselCrew().Count; // when the crewcount is eq 0 than look into the protoVessel if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null) crewcount = v.protoVessel.GetVesselCrew().Count; RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount); try { IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppms.GetInt("RTCommandMinCrew"); RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})", Powered, v.HasCommandStation(), crewcount, ppms.GetInt("RTCommandMinCrew")); } catch (ArgumentException argexeception) { // I'm assuming this would get thrown by ppms.GetInt()... do the other functions have an exception spec? IsCommandStation = false; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), crewcount); RTLog.Notify("ProtoSignalProcessor ", argexeception); } }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { Vessel = v; Powered = ppms.GetBool("IsRTPowered"); CommandStation = Powered && v.HasCommandStation() && v.GetVesselCrew().Count >= 6; RTUtil.Log("ProtoSignalProcessor: Powered: {0}, CommandStation: {1}, Crew: {2}", Powered, v.HasCommandStation(), v.GetVesselCrew().Count); }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { mVessel = v; Powered = ppms.GetBool("IsRTPowered"); try { IsCommandStation = Powered && v.HasCommandStation() && v.GetVesselCrew().Count >= ppms.GetInt("RTCommandMinCrew"); RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})", Powered, v.HasCommandStation(), v.GetVesselCrew().Count, ppms.GetInt("RTCommandMinCrew")); } catch (ArgumentException) { // I'm assuming this would get thrown by ppms.GetInt()... do the other functions have an exception spec? IsCommandStation = false; RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), v.GetVesselCrew().Count); } }
public static bool IsAntenna(this ProtoPartModuleSnapshot ppms) { return(ppms.GetBool("IsRTAntenna") && ppms.GetBool("IsRTPowered") && ppms.GetBool("IsRTActive")); }
public static bool IsCommandStation(this ProtoPartModuleSnapshot ppms) { return(ppms.GetBool("IsRTCommandStation")); }
public static bool IsSignalProcessor(this ProtoPartModuleSnapshot ppms) { return(ppms.GetBool("IsRTSignalProcessor")); }
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v) { Vessel = v; Powered = ppms.GetBool("IsPowered"); CommandStation = Powered && v.HasCommandStation() && Vessel.GetVesselCrew().Count >= 6; }