public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); if (!row.Exists("AllowGoToJail")) { error = "AllowGoToJail missing"; return(false); } mAllowGoToJail = row.GetBool("AllowGoToJail"); mBail = new IntegerOption.OptionValue(-1); if (row.Exists("Bail")) { if (!mBail.Parse(row, "Bail", Manager, this, ref error)) { return(false); } } mInvestigate = new InvestigationHelper(); if (!mInvestigate.Parse(row, Manager, this, ref error)) { return(false); } mMinimum = new IntegerOption.OptionValue(); if (!mMinimum.Parse(row, "Minimum", Manager, this, ref error)) { return(false); } mMaximum = new IntegerOption.OptionValue(); if (!mMaximum.Parse(row, "Maximum", Manager, this, ref error)) { return(false); } mKeepObject = row.GetBool("KeepObject"); mSneakinessScoring = row.GetString("SneakinessScoring"); mSuccess = new WeightScenarioHelper(Origin.FromBurglar); if (!mSuccess.Parse(row, Manager, this, "Success", ref error)) { return(false); } mFailure = new WeightScenarioHelper(Origin.FromBurglar); if (!mFailure.Parse(row, Manager, this, "Failure", ref error)) { return(false); } return(base.Parse(row, ref error)); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mAllowDebt = row.GetBool("AllowDebt"); if (row.Exists("AccountingKey")) { mAccountingKey = row.GetString("AccountingKey"); } else { error = "AccountingKey missing"; return(false); } mFight = new FightScenarioHelper(Origin.FromTheft, SimDescription.DeathType.OldAge); if (!mFight.Parse(row, Manager, this, ref error)) { return(false); } mInvestigate = new InvestigationHelper(); if (!mInvestigate.Parse(row, Manager, this, ref error)) { return(false); } mMinimum = new IntegerOption.OptionValue(); if (!mMinimum.Parse(row, "Minimum", Manager, this, ref error)) { return(false); } mMaximum = new IntegerOption.OptionValue(); if (!mMaximum.Parse(row, "Maximum", Manager, this, ref error)) { return(false); } return(base.Parse(row, ref error)); }