示例#1
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = row.GetString("Name");

            if (!mMinimum.Parse(row, "Minimum", Manager, ref error))
            {
                return(false);
            }

            if (!mMaximum.Parse(row, "Maximum", Manager, ref error))
            {
                return(false);
            }

            mAllowGoToJail = row.GetBool("AllowGoToJail");

            mKeepObject = row.GetBool("KeepObject");

            mSneakinessScoring = row.GetString("SneakinessScoring");

            mSuccess = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mSuccess.Parse(row, Manager, "Success", ref error))
            {
                return(false);
            }

            mFailure = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mFailure.Parse(row, Manager, "Failure", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
示例#2
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mBail = new IntegerOption.OptionValue(-1);
            if (row.Exists("Bail"))
            {
                if (!mBail.Parse(row, "Bail", Manager, this, ref error))
                {
                    return(false);
                }
            }

            mChance = new IntegerOption.OptionValue();
            if (!mChance.Parse(row, "Chance", Manager, this, ref error))
            {
                return(false);
            }

            mSuccess = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
示例#3
0
        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));
        }
示例#4
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mMinimumWealth = new IntegerOption.OptionValue();
            if (!mMinimumWealth.Parse(row, "MinimumWealth", Manager, this, ref error))
            {
                return(false);
            }

            mSuccess = new WeightScenarioHelper(Origin.FromStore);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
示例#5
0
        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));
        }
示例#6
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mMaximum = new IntegerOption.OptionValue();

            if (row.Exists("AlterKey"))
            {
                mAlterKey = row.GetString("AlterKey");
            }
            else
            {
                if (row.Exists("AccountingKey"))
                {
                    mAccountingKey = row.GetString("AccountingKey");
                }
                else
                {
                    error = "AccountingKey missing";
                    return(false);
                }

                if (!mMaximum.Parse(row, "Maximum", Manager, this, ref error))
                {
                    return(false);
                }
            }

            mMinimum = new IntegerOption.OptionValue();
            if (!mMinimum.Parse(row, "Minimum", Manager, this, ref error))
            {
                return(false);
            }

            mSuccess = new WeightScenarioHelper(Origin.FromGettingGifts);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return(false);
            }

            return(base.Parse(row, ref error));
        }
示例#7
0
        public bool Parse(XmlDbRow row, StoryProgressionObject manager, IUpdateManager updater, ref string error)
        {
            mStoryName = row.GetString("InvestigateStoryName");

            mMinimum = new IntegerOption.OptionValue();
            if (!mMinimum.Parse(row, "InvestigateMinimum", manager, updater, ref error))
            {
                mMinimum = null;

                error = null;
                //return false;
            }

            mMaximum = new IntegerOption.OptionValue();
            if (!mMaximum.Parse(row, "InvestigateMaximum", manager, updater, ref error))
            {
                mMaximum = null;

                error = null;
                //return false;
            }

            return true;
        }
示例#8
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            if (row.Exists("AccountingKey"))
            {
                mAccountingKey = row.GetString("AccountingKey");
            }
            else
            {
                error = "AccountingKey missing";
                return false;
            }

            mAllowDebt = new BooleanOption.OptionValue();
            if (!mAllowDebt.Parse(row, "AllowDebt", 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;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromGettingGifts);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            return base.Parse(row, ref error);
        }
示例#9
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mChanceOfPregnancy = new IntegerOption.OptionValue(-1);

            if (row.Exists("ChanceOfPregnancy"))
            {
                if (!mChanceOfPregnancy.Parse(row, "ChanceOfPregnancy", Manager, this, ref error))
                {
                    return(false);
                }
            }

            mAllowPartner = row.GetBool("AllowPartner");

            if (!row.Exists("TypeOfStory"))
            {
                error = "TypeOfStory missing";
                return(false);
            }
            else if (!ParserFunctions.TryParseEnum <TypeOfStory>(row.GetString("TypeOfStory"), out mTypeOfStory, TypeOfStory.None))
            {
                error = "TypeOfStory unknown";
                return(false);
            }

            mSuccess = new WeightScenarioHelper(Origin.FromRomanticBetrayal);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return(false);
            }

            mFailure = new WeightScenarioHelper(Origin.FromRomanticBetrayal);
            if (!mFailure.Parse(row, Manager, this, "Failure", ref error))
            {
                return(false);
            }

            if (!base.Parse(row, ref error))
            {
                return(false);
            }

            if (!row.Exists("AffairStory"))
            {
                error = "AffairStory missing";
                return(false);
            }

            if (!ParserFunctions.TryParseEnum <ManagerRomance.AffairStory>(row.GetString("AffairStory"), out mAffairStory, ManagerRomance.AffairStory.None))
            {
                error = "AffairStory unknown";
                return(false);
            }

            if (mAffairStory != ManagerRomance.AffairStory.None)
            {
                if ((!Filter.AllowAffair) && (!TargetFilter.AllowAffair))
                {
                    error = "ActorAllowAffair or TargetAllowAffair must be True";
                    return(false);
                }
            }
            else
            {
                if ((Filter.AllowAffair) || (TargetFilter.AllowAffair))
                {
                    error = "ActorAllowAffair and TargetAllowAffair must be False";
                    return(false);
                }
            }

            mAcceptanceScoring = row.GetString("AcceptanceScoring");

            return(true);
        }
示例#10
0
        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);
        }
示例#11
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            if (row.Exists("AllowMultiple"))
            {
                mAllowMultiple = row.GetBool("AllowMultiple");
            }

            mMinimumWealth = new IntegerOption.OptionValue();
            if (!mMinimumWealth.Parse(row, "MinimumWealth", Manager, this, ref error))
            {
                return false;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromStore);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            return base.Parse(row, ref error);
        }
示例#12
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mBail = new IntegerOption.OptionValue(-1);
            if (row.Exists("Bail"))
            {
                if (!mBail.Parse(row, "Bail", Manager, this, ref error))
                {
                    return false;
                }
            }

            mChance = new IntegerOption.OptionValue();
            if (!mChance.Parse(row, "Chance", Manager, this, ref error))
            {
                return false;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromBurglar);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            return base.Parse(row, ref error);
        }
示例#13
0
        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;
                }
            }

            if (!row.Exists("AllowInjury"))
            {
                error = "AllowInjury missing";
                return false;
            }

            mAllowInjury = row.GetBool("AllowInjury");

            mSneakinessScoring = row.GetString("SneakinessScoring");

            mInvestigate = new InvestigationHelper();
            if (!mInvestigate.Parse(row, Manager, this, ref error))
            {
                return false;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromFire);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            mFailure = new WeightScenarioHelper(Origin.FromFire);
            if (!mFailure.Parse(row, Manager, this, "Failure", ref error))
            {
                return false;
            }

            return base.Parse(row, ref error);
        }
示例#14
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            if (row.Exists("AccountingKey"))
            {
                mAccountingKey = row.GetString("AccountingKey");
            }
            else
            {
                error = "AccountingKey missing";
                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;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromCharity);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            mFailure = new WeightScenarioHelper(Origin.FromCharity);
            if (!mFailure.Parse(row, Manager, this, "Failure", ref error))
            {
                return false;
            }

            mAcceptanceScoring = row.GetString("AcceptanceScoring");

            return base.Parse(row, ref error);
        }
示例#15
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mChanceOfPregnancy = new IntegerOption.OptionValue(-1);

            if (row.Exists("ChanceOfPregnancy"))
            {
                if (!mChanceOfPregnancy.Parse(row, "ChanceOfPregnancy", Manager, this, ref error))
                {
                    return false;
                }
            }

            mAllowPartner = row.GetBool("AllowPartner");

            if (!row.Exists("TypeOfStory"))
            {
                error = "TypeOfStory missing";
                return false;
            }
            else if (!ParserFunctions.TryParseEnum<TypeOfStory>(row.GetString("TypeOfStory"), out mTypeOfStory, TypeOfStory.None))
            {
                error = "TypeOfStory unknown";
                return false;
            }

            mSuccess = new WeightScenarioHelper(Origin.FromRomanticBetrayal);
            if (!mSuccess.Parse(row, Manager, this, "Success", ref error))
            {
                return false;
            }

            mFailure = new WeightScenarioHelper(Origin.FromRomanticBetrayal);
            if (!mFailure.Parse(row, Manager, this, "Failure", ref error))
            {
                return false;
            }

            if (!base.Parse(row, ref error))
            {
                return false;
            }

            if (!row.Exists("AffairStory"))
            {
                error = "AffairStory missing";
                return false;
            }

            if (!ParserFunctions.TryParseEnum<ManagerRomance.AffairStory>(row.GetString("AffairStory"), out mAffairStory, ManagerRomance.AffairStory.None))
            {
                error = "AffairStory unknown";
                return false;
            }

            if (mAffairStory != ManagerRomance.AffairStory.None)
            {
                if ((!Filter.AllowAffair) && (!TargetFilter.AllowAffair))
                {
                    error = "ActorAllowAffair or TargetAllowAffair must be True";
                    return false;
                }
            }
            else
            {
                if ((Filter.AllowAffair) || (TargetFilter.AllowAffair))
                {
                    error = "ActorAllowAffair and TargetAllowAffair must be False";
                    return false;
                }
            }

            mAcceptanceScoring = row.GetString("AcceptanceScoring");

            return true;
        }