Example #1
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = new WeightOption.NameOption(row);

            mInjuredStory = row.GetString("InjuredStory");

            if (!ParserFunctions.TryParseEnum <SimDescription.DeathType>(row.GetString("Type"), out mType, SimDescription.DeathType.None))
            {
                error = "Type not valid";
                return(false);
            }

            if (mType == SimDescription.DeathType.None)
            {
                error = "Type cannot be None";
                return(false);
            }

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

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

            if (row.Exists("ChildStory"))
            {
                mChildStory = row.GetBool("ChildStory");
            }

            if (row.Exists("AllowDoorPranks"))
            {
                mAllowDoorPranks = row.GetBool("AllowDoorPranks");
            }

            mSneakinessScoring = row.GetString("SneakinessScoring");

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

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

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

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

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

            mbShouldFire = row.GetBool("ShouldFire");

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

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

            mAllowSkill  = row.GetBool("AllowSkill");
            mAllowNormal = row.GetBool("AllowNormal");

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

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

            mTargetFilter = new SimScenarioFilter();
            if (!mTargetFilter.Parse(row, Manager, this, "Target", true, ref error))
            {
                return(false);
            }

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

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

            mCheckAny = row.GetBool("CheckAny");

            mDelta = row.GetInt("Delta", mDelta);

            if (row.Exists("Ages"))
            {
                mAges = row.GetEnum <CASAgeGenderFlags>("Ages", CASAgeGenderFlags.None);
                if (mAges == CASAgeGenderFlags.None)
                {
                    error = "Invalid Ages: " + row.GetString("Ages");
                    return(false);
                }
            }

            if (row.Exists("CheckExisting"))
            {
                mCheckExisting = row.GetBool("CheckExisting");
            }

            if (row.Exists("Species"))
            {
                ToCASAgeGenderFlags converter = new ToCASAgeGenderFlags();

                mSpecies = converter.Convert(row.GetString("Species"));
                if (mSpecies == null)
                {
                    error = converter.mError;
                    return(false);
                }
            }

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

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

            mChanceOfHomeLot = row.GetInt("ChanceOfHome", mChanceOfHomeLot);

            mPartyAttire = row.GetEnum <OutfitCategories>("Attire", OutfitCategories.None);
            if (mPartyAttire == OutfitCategories.None)
            {
                error = "Unknown Attire: " + row.GetString("Attire");
                return(false);
            }

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

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

            if (row.Exists("Skill"))
            {
                mSkill = SkillManager.sSkillEnumValues.ParseEnumValue(row.GetString("Skill"));
                if (mSkill == SkillNames.None)
                {
                    error = "Skill unknown";
                    return(false);
                }
            }

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

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

            mChance = row.GetInt("Chance", mChance);

            mAcceptanceScoring = row.GetString("AcceptanceScoring");

            mSuccess = new WeightScenarioHelper(Origin.None);
            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);
            }

            return(base.Parse(row, ref error));
        }
Example #16
0
        public override bool Parse(XmlDbRow row, ref string error)
        {
            mName = row.GetString("Name");

            mAllowGoToJail = row.GetBool("AllowGoToJail");

            mAllowInjury = row.GetBool("AllowInjury");

            mSneakinessScoring = row.GetString("SneakinessScoring");

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

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

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

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

            if (!row.Exists("Locale"))
            {
                error = "Locale Missing";
                return(false);
            }

            if (!row.TryGetEnum <Locales>("Locale", out mLocale, Locales.Home))
            {
                error = "Unknown Locale";
                return(false);
            }

            return(base.Parse(row, ref error));
        }
Example #18
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);
        }