public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, SimDescription.DeathType.Thirst); if (!mFight.Parse(row, Manager, this, ref error)) { return(false); } return(base.Parse(row, ref error)); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); if (row.Exists("ChildStory")) { mChildStory = row.GetBool("ChildStory"); } mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, DeathType); if (!mFight.Parse(row, Manager, this, 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)); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, DeathType); if (!mFight.Parse(row, Manager, this, ref error)) { return(false); } if (!row.Exists("ReaddOldLeader")) { error = "ReaddOldLeader Missing"; return(false); } mReaddOldLeader = row.GetBool("ReaddOldLeader"); return(base.Parse(row, ref error)); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, DeathType); if (!mFight.Parse(row, Manager, this, ref error)) { return false; } if (!row.Exists("ReaddOldLeader")) { error = "ReaddOldLeader Missing"; return false; } mReaddOldLeader = row.GetBool("ReaddOldLeader"); 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); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, SimDescription.DeathType.Thirst); if (!mFight.Parse(row, Manager, this, ref error)) { return false; } return base.Parse(row, ref error); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, SimDescription.DeathType.OldAge); if (!mFight.Parse(row, Manager, this, ref error)) { return false; } mTraitReasons = new Dictionary<TraitNames, string>(); int index = 0; while (true) { if (!row.Exists("ReasonTrait" + index)) break; TraitNames trait; if (!ParserFunctions.TryParseEnum<TraitNames>(row.GetString("ReasonTrait" + index), out trait, TraitNames.Unknown)) { error = "ReasonTrait" + index + " unknown"; return false; } if (mTraitReasons.ContainsKey(trait)) { error = "ReasonTrait " + trait + " already found"; return false; } if (!row.Exists("ReasonTraitName" + index)) { error = "ReasonTraitName" + index + " missing"; return false; } string text = row.GetString("ReasonTraitName" + index); mTraitReasons.Add(trait, text); index++; } mAgeGenderReasons = new Dictionary<CASAgeGenderFlags, string>(); index = 0; while (true) { if (!row.Exists("ReasonAgeGender" + index)) break; CASAgeGenderFlags ageGender; if (!ParserFunctions.TryParseEnum<CASAgeGenderFlags>(row.GetString("ReasonAgeGender" + index), out ageGender, CASAgeGenderFlags.None)) { error = "ReasonAgeGender" + index + " unknown"; return false; } if (mAgeGenderReasons.ContainsKey(ageGender)) { error = "ReasonAgeGender " + ageGender + " already found"; return false; } if (!row.Exists("ReasonAgeGenderName" + index)) { error = "ReasonAgeGenderName" + index + " missing"; return false; } string text = row.GetString("ReasonAgeGenderName" + index); mAgeGenderReasons.Add(ageGender, text); index++; } if ((mTraitReasons.Count == 0) && (mAgeGenderReasons.Count == 0)) { error = "No Reasons found"; return false; } return base.Parse(row, ref error); }
public override bool Parse(XmlDbRow row, ref string error) { mName = new WeightOption.NameOption(row); mFight = new FightScenarioHelper(Origin.FromWatchingSimSuffer, SimDescription.DeathType.OldAge); if (!mFight.Parse(row, Manager, this, ref error)) { return(false); } mTraitReasons = new Dictionary <TraitNames, string>(); int index = 0; while (true) { if (!row.Exists("ReasonTrait" + index)) { break; } TraitNames trait; if (!ParserFunctions.TryParseEnum <TraitNames>(row.GetString("ReasonTrait" + index), out trait, TraitNames.Unknown)) { error = "ReasonTrait" + index + " unknown"; return(false); } if (mTraitReasons.ContainsKey(trait)) { error = "ReasonTrait " + trait + " already found"; return(false); } if (!row.Exists("ReasonTraitName" + index)) { error = "ReasonTraitName" + index + " missing"; return(false); } string text = row.GetString("ReasonTraitName" + index); mTraitReasons.Add(trait, text); index++; } mAgeGenderReasons = new Dictionary <CASAgeGenderFlags, string>(); index = 0; while (true) { if (!row.Exists("ReasonAgeGender" + index)) { break; } CASAgeGenderFlags ageGender; if (!ParserFunctions.TryParseEnum <CASAgeGenderFlags>(row.GetString("ReasonAgeGender" + index), out ageGender, CASAgeGenderFlags.None)) { error = "ReasonAgeGender" + index + " unknown"; return(false); } if (mAgeGenderReasons.ContainsKey(ageGender)) { error = "ReasonAgeGender " + ageGender + " already found"; return(false); } if (!row.Exists("ReasonAgeGenderName" + index)) { error = "ReasonAgeGenderName" + index + " missing"; return(false); } string text = row.GetString("ReasonAgeGenderName" + index); mAgeGenderReasons.Add(ageGender, text); index++; } if ((mTraitReasons.Count == 0) && (mAgeGenderReasons.Count == 0)) { error = "No Reasons found"; return(false); } return(base.Parse(row, ref error)); }