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);
            }
        }
示例#3
0
        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)
        {
            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);
            }
        }
示例#5
0
        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);
            }
        }