Ejemplo n.º 1
0
 public override void OnStart(StartState state)
 {
     if (repairConfig == null && !String.IsNullOrEmpty(repairConfigString))
     {
         repairConfig = RepairConfig.FromString(repairConfigString);
     }
 }
Ejemplo n.º 2
0
        public static RepairConfig FromString(string s)
        {
            if (String.IsNullOrEmpty(s))
            {
                return(null);
            }

            RepairConfig repairConfig = null;

            string[] sections = s.Split(new char[1] {
                ','
            });
            if (sections.Length == 10)
            {
                repairConfig = new RepairConfig();
                repairConfig.canBeRepairedInFlight   = bool.Parse(sections[0]);
                repairConfig.canBeRepairedOnSplashed = bool.Parse(sections[1]);
                repairConfig.canBeRepairedByRemote   = bool.Parse(sections[2]);
                repairConfig.requiresEVA             = bool.Parse(sections[3]);

                repairConfig.repairChance = int.Parse(sections[4]);

                repairConfig.dataScale = float.Parse(sections[5]);
                repairConfig.dataScale = float.Parse(sections[6]);

                repairConfig.replacementPart         = sections[7];
                repairConfig.replacementPartOptional = bool.Parse(sections[8]);
                repairConfig.replacementPartBonus    = float.Parse(sections[9]);
            }

            return(repairConfig);
        }
Ejemplo n.º 3
0
        public static RepairConfig FromString(string s)
        {
            if (String.IsNullOrEmpty(s))
                return null;

            RepairConfig repairConfig = null;
            string[] sections = s.Split(new char[1] { ',' });
            if (sections.Length == 10)
            {
                repairConfig = new RepairConfig();
                repairConfig.canBeRepairedInFlight = bool.Parse(sections[0]);
                repairConfig.canBeRepairedOnSplashed = bool.Parse(sections[1]);
                repairConfig.canBeRepairedByRemote = bool.Parse(sections[2]);
                repairConfig.requiresEVA = bool.Parse(sections[3]);

                repairConfig.repairChance = int.Parse(sections[4]);

                repairConfig.dataScale = float.Parse(sections[5]);
                repairConfig.dataScale = float.Parse(sections[6]);

                repairConfig.replacementPart = sections[7];
                repairConfig.replacementPartOptional = bool.Parse(sections[8]);
                repairConfig.replacementPartBonus = float.Parse(sections[9]);
            }

            return repairConfig;
        }
Ejemplo n.º 4
0
 public override void OnStart(StartState state)
 {
     if (repairConfig == null && repairConfigString.Length > 0)
     {
         repairConfig = RepairConfig.FromString(repairConfigString);
     }
     base.OnStart(state);
 }
Ejemplo n.º 5
0
 public override void OnLoad(ConfigNode node)
 {
     if (node.HasNode("REPAIR"))
     {
         repairConfig = new RepairConfig();
         repairConfig.Load(node.GetNode("REPAIR"));
         repairConfigString = repairConfig.ToString();
     }
     else
     {
         repairConfig = null;
     }
     base.OnLoad(node);
 }
Ejemplo n.º 6
0
 public override void OnStart(StartState state)
 {
     if (repairConfig == null && !String.IsNullOrEmpty(repairConfigString))
     {
         repairConfig = RepairConfig.FromString(repairConfigString);
     }
 }
Ejemplo n.º 7
0
 public override void OnLoad(ConfigNode node)
 {
     if (node.HasNode("REPAIR"))
     {
         repairConfig = new RepairConfig();
         repairConfig.Load(node.GetNode("REPAIR"));
         repairConfigString = repairConfig.ToString();
     }
     else
     {
         repairConfig = null;
     }
     base.OnLoad(node);
 }