Beispiel #1
0
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MPL OnLoad");
     msgSlot = getLabEquipmentSlotByType(node, MSG_LAB_EQUIPMENT_TYPE);
     usuSlot = getLabEquipmentSlotByType(node, USU_LAB_EQUIPMENT_TYPE);
 }
        protected ConfigNode getConfigNodeForSlot(string nodeName, LabEquipmentSlot slot)
        {
            ConfigNode node = new ConfigNode(nodeName);

            node.AddNode(slot.getConfigNode());
            return(node);
        }
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MPL OnLoad");
     msgSlot = getLabEquipmentSlot(node.GetNode(MSG_CONFIG_NODE_NAME));
     usuSlot = getLabEquipmentSlot(node.GetNode(USU_CONFIG_NODE_NAME));
 }
Beispiel #4
0
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MSL OnLoad");
     cirSlot     = getLabEquipmentSlot(node.GetNode(CIR_CONFIG_NODE_NAME));
     firSlot     = getLabEquipmentSlot(node.GetNode(FIR_CONFIG_NODE_NAME));
     printerSlot = getLabEquipmentSlot(node.GetNode(DPR_CONFIG_NODE_NAME));
 }
Beispiel #5
0
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MSL OnLoad");
     cirSlot     = getLabEquipmentSlotByType(node, CIR_LAB_EQUIPMENT_TYPE);
     firSlot     = getLabEquipmentSlotByType(node, FIR_LAB_EQUIPMENT_TYPE);
     printerSlot = getLabEquipmentSlotByType(node, PRINTER_LAB_EQUIPMENT_TYPE);
 }
Beispiel #6
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);
            string stateString = node.GetValue(MEP_STATE_VALUE);

            if (stateString != null)
            {
                MEPlabState = MEPLabStatusFactory.getType(stateString);
            }
            exposureSlot = getLabEquipmentSlotByType(node, EXPOSURE_LAB_EQUIPMENT_TYPE);
        }
Beispiel #7
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);
            string stateString = node.GetValue(MEP_STATE_VALUE);

            if (stateString != null)
            {
                MEPlabState = MEPLabStatusFactory.getType(stateString);
            }
            exposureSlot = getLabEquipmentSlot(node.GetNode(SLOT_CONFIG_NODE_NAME));
        }
 protected LabEquipmentSlot getLabEquipmentSlot(ConfigNode configNode)
 {
     if (configNode != null)
     {
         return(LabEquipmentSlot.getLabEquipmentSlotFromConfigNode(configNode.GetNode(LabEquipmentSlot.CONFIG_NODE_NAME), this));
     }
     else
     {
         NE_Helper.logError("Lab GetLabEquipmentSlotFromNode: LabEquipmentSlotNode null");
         return(new LabEquipmentSlot(EquipmentRacks.NONE));
     }
 }
        protected LabEquipmentSlot getLabEquipmentSlotByType(ConfigNode configNode, string type)
        {
            LabEquipmentSlot rv = null;

            if (configNode == null)
            {
                NE_Helper.logError("Lab getLabEquipmentSlotByType: parent node null");
                goto done;
            }

            // Find a NE_LabEquipmentSlot of the correct type
            ConfigNode cn = configNode.GetNode(LabEquipmentSlot.CONFIG_NODE_NAME, "type", type);

            if (cn == null)
            {
                // Pre-Kemini-0.3 savegames have another level of nesting of ConfigNodes so let's recursively look into the child-nodes
                foreach (ConfigNode child in configNode.nodes)
                {
                    rv = getLabEquipmentSlotByType(child, type);
                    if (rv != null)
                    {
                        goto done;
                    }
                }

                // Not found, so let's raise an error
                NE_Helper.logError("Lab getLabEquipmentSlotByType: node " + configNode.name
                                   + " does not contain a " + LabEquipmentSlot.CONFIG_NODE_NAME
                                   + " node of type " + type);
                goto done;
            }
            rv = LabEquipmentSlot.getLabEquipmentSlotFromConfigNode(cn, this);

done:
            return(rv != null? rv : new LabEquipmentSlot(EquipmentRacks.NONE));
        }
Beispiel #10
0
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MPL OnLoad");
     keminiSlot = getLabEquipmentSlot(node.GetNode(KEMINI_CONFIG_NODE_NAME));
 }
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     string stateString = node.GetValue(MEP_STATE_VALUE);
     if (stateString != null)
     {
         MEPlabState = MEPLabStatusFactory.getType(stateString);
     }
     exposureSlot = getLabEquipmentSlot(node.GetNode(SLOT_CONFIG_NODE_NAME));
 }
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MPL OnLoad");
     keminiSlot = getLabEquipmentSlot(node.GetNode(KEMINI_CONFIG_NODE_NAME));
 }
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MSL OnLoad");
     cirSlot = getLabEquipmentSlot(node.GetNode(CIR_CONFIG_NODE_NAME));
     firSlot = getLabEquipmentSlot(node.GetNode(FIR_CONFIG_NODE_NAME));
     printerSlot = getLabEquipmentSlot(node.GetNode(DPR_CONFIG_NODE_NAME));
 }
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("MPL OnLoad");
     msgSlot = getLabEquipmentSlot(node.GetNode(MSG_CONFIG_NODE_NAME));
     usuSlot = getLabEquipmentSlot(node.GetNode(USU_CONFIG_NODE_NAME));
 }
Beispiel #15
0
 public override void OnLoad(ConfigNode node)
 {
     base.OnLoad(node);
     NE_Helper.log("KL OnLoad");
     keminiSlot = getLabEquipmentSlotByType(node, KEMINI_LAB_EQUIPMENT_TYPE);
 }