Esempio n. 1
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));
        }
Esempio n. 2
0
 protected TorchScenario(TorchScenario scenario)
     : base(scenario)
 {
     mName              = scenario.mName;
     mAllowInjury       = scenario.mAllowInjury;
     mSuccess           = scenario.mSuccess;
     mFailure           = scenario.mFailure;
     mSneakinessScoring = scenario.mSneakinessScoring;
     mAllowGoToJail     = scenario.mAllowGoToJail;
     mBail              = scenario.mBail;
     mInvestigate       = scenario.mInvestigate;
 }
Esempio n. 3
0
 protected TakeCashScenario(TakeCashScenario scenario)
     : base(scenario)
 {
     mName          = scenario.mName;
     mMinimum       = scenario.mMinimum;
     mMaximum       = scenario.mMaximum;
     mAllowDebt     = scenario.mAllowDebt;
     mAccountingKey = scenario.mAccountingKey;
     mFight         = scenario.mFight;
     mFail          = scenario.mFail;
     mInvestigate   = scenario.mInvestigate;
 }
Esempio n. 4
0
 protected BurgleScenario(BurgleScenario scenario)
     : base(scenario)
 {
     mName              = scenario.mName;
     mMinimum           = scenario.mMinimum;
     mMaximum           = scenario.mMaximum;
     mKeepObject        = scenario.mKeepObject;
     mSuccess           = scenario.mSuccess;
     mFailure           = scenario.mFailure;
     mSneakinessScoring = scenario.mSneakinessScoring;
     mAllowGoToJail     = scenario.mAllowGoToJail;
     mBail              = scenario.mBail;
     mInvestigate       = scenario.mInvestigate;
 }
Esempio n. 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));
        }