public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue<ExperimentalPart.UnlockCriteria>(configNode, "unlockCriteria", x => unlockCriteria = x, this, ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE);
            if (unlockCriteria == ExperimentalPart.UnlockCriteria.PARAMETER_COMPLETION)
            {
                valid &= ConfigNodeUtil.ParseValue<string>(configNode, "unlockParameter", x => unlockParameter = x, this);
            }
            valid &= ConfigNodeUtil.ParseValue<ExperimentalPart.LockCriteria>(configNode, "lockCriteria", x => lockCriteria = x, this, ExperimentalPart.LockCriteria.CONTRACT_COMPLETION);
            if (lockCriteria == ExperimentalPart.LockCriteria.PARAMETER_COMPLETION)
            {
                valid &= ConfigNodeUtil.ParseValue<string>(configNode, "lockParameter", x => lockParameter = x, this);
            }

            valid &= ConfigNodeUtil.ParseValue<List<AvailablePart>>(configNode, "part", x => parts = x, this);

            if (configNode.HasValue("add"))
            {
                LoggingUtil.LogWarning(this, "The 'add' attribute of ExperimentalPartFactory is deprecated.  Use 'unlockCriteria' instead.");
                valid &= ConfigNodeUtil.ParseValue<bool>(configNode, "add", x => unlockCriteria = x ? ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.UnlockCriteria.DO_NOT_UNLOCK, this);
            }
            if (configNode.HasValue("remove"))
            {
                LoggingUtil.LogWarning(this, "The 'remove' attribute of ExperimentalPartFactory is deprecated.  Use 'lockCriteria' instead.");
                valid &= ConfigNodeUtil.ParseValue<bool>(configNode, "remove", x => lockCriteria = x ? ExperimentalPart.LockCriteria.CONTRACT_COMPLETION : ExperimentalPart.LockCriteria.DO_NOT_LOCK, this);
            }

            return valid;
        }
        public override bool Load(ConfigNode configNode)
        {
            // Load base class
            bool valid = base.Load(configNode);

            valid &= ConfigNodeUtil.ParseValue <ExperimentalPart.UnlockCriteria>(configNode, "unlockCriteria", x => unlockCriteria = x, this, ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE);
            if (unlockCriteria == ExperimentalPart.UnlockCriteria.PARAMETER_COMPLETION)
            {
                valid &= ConfigNodeUtil.ParseValue <string>(configNode, "unlockParameter", x => unlockParameter = x, this);
            }
            valid &= ConfigNodeUtil.ParseValue <ExperimentalPart.LockCriteria>(configNode, "lockCriteria", x => lockCriteria = x, this, ExperimentalPart.LockCriteria.CONTRACT_COMPLETION);
            if (lockCriteria == ExperimentalPart.LockCriteria.PARAMETER_COMPLETION)
            {
                valid &= ConfigNodeUtil.ParseValue <string>(configNode, "lockParameter", x => lockParameter = x, this);
            }

            valid &= ConfigNodeUtil.ParseValue <List <AvailablePart> >(configNode, "part", x => parts = x, this);

            if (configNode.HasValue("add"))
            {
                LoggingUtil.LogWarning(this, "The 'add' attribute of ExperimentalPartFactory is deprecated.  Use 'unlockCriteria' instead.");
                valid &= ConfigNodeUtil.ParseValue <bool>(configNode, "add", x => unlockCriteria = x ? ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.UnlockCriteria.DO_NOT_UNLOCK, this);
            }
            if (configNode.HasValue("remove"))
            {
                LoggingUtil.LogWarning(this, "The 'remove' attribute of ExperimentalPartFactory is deprecated.  Use 'lockCriteria' instead.");
                valid &= ConfigNodeUtil.ParseValue <bool>(configNode, "remove", x => lockCriteria = x ? ExperimentalPart.LockCriteria.CONTRACT_COMPLETION : ExperimentalPart.LockCriteria.DO_NOT_LOCK, this);
            }

            return(valid);
        }
        protected override void OnLoad(ConfigNode configNode)
        {
            parts = ConfigNodeUtil.ParseValue <List <AvailablePart> >(configNode, "part");

            if (configNode.HasValue("remove"))
            {
                bool remove = ConfigNodeUtil.ParseValue <bool>(configNode, "remove");
                lockCriteria = remove ? ExperimentalPart.LockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.LockCriteria.DO_NOT_LOCK;
            }
            else
            {
                lockCriteria  = ConfigNodeUtil.ParseValue <LockCriteria>(configNode, "lockCriteria");
                lockParameter = ConfigNodeUtil.ParseValue <string>(configNode, "lockParameter", "");
            }

            if (configNode.HasValue("add"))
            {
                bool add = ConfigNodeUtil.ParseValue <bool>(configNode, "add");
                unlockCriteria = add ? ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.UnlockCriteria.DO_NOT_UNLOCK;
            }
            else
            {
                unlockCriteria  = ConfigNodeUtil.ParseValue <UnlockCriteria>(configNode, "unlockCriteria");
                unlockParameter = ConfigNodeUtil.ParseValue <string>(configNode, "unlockParameter", "");
            }
        }
 public ExperimentalPart(List<AvailablePart> parts, UnlockCriteria unlockCriteria, string unlockParameter, LockCriteria lockCriteria, string lockParameter)
 {
     this.parts = parts;
     this.unlockCriteria = unlockCriteria;
     this.unlockParameter = unlockParameter;
     this.lockCriteria = lockCriteria;
     this.lockParameter = lockParameter;
 }
 public ExperimentalPart(List <AvailablePart> parts, UnlockCriteria unlockCriteria, string unlockParameter, LockCriteria lockCriteria, string lockParameter)
 {
     this.parts           = parts;
     this.unlockCriteria  = unlockCriteria;
     this.unlockParameter = unlockParameter;
     this.lockCriteria    = lockCriteria;
     this.lockParameter   = lockParameter;
 }
        protected override void OnLoad(ConfigNode configNode)
        {
            parts = ConfigNodeUtil.ParseValue<List<AvailablePart>>(configNode, "part");

            if (configNode.HasValue("remove"))
            {
                bool remove = ConfigNodeUtil.ParseValue<bool>(configNode, "remove");
                lockCriteria = remove ? ExperimentalPart.LockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.LockCriteria.DO_NOT_LOCK;
            }
            else
            {
                lockCriteria = ConfigNodeUtil.ParseValue<LockCriteria>(configNode, "lockCriteria");
                lockParameter = ConfigNodeUtil.ParseValue<string>(configNode, "lockParameter", "");
            }

            if (configNode.HasValue("add"))
            {
                bool add = ConfigNodeUtil.ParseValue<bool>(configNode, "add");
                unlockCriteria = add ? ExperimentalPart.UnlockCriteria.CONTRACT_ACCEPTANCE : ExperimentalPart.UnlockCriteria.DO_NOT_UNLOCK;
            }
            else
            {
                unlockCriteria = ConfigNodeUtil.ParseValue<UnlockCriteria>(configNode, "unlockCriteria");
                unlockParameter = ConfigNodeUtil.ParseValue<string>(configNode, "unlockParameter", "");
            }
        }