Exemplo n.º 1
0
        public bool Parse(XmlDbRow row, StoryProgressionObject manager, IUpdateManager updater, string prefix, ref string error)
        {
            if ((!string.IsNullOrEmpty(prefix)) && (!Parse(row, manager, updater, null, ref error)))
            {
                return(false);
            }

            if (row.Exists(prefix + "RecruitAllowSteal"))
            {
                mAllowSteal = row.GetBool(prefix + "RecruitAllowSteal");
            }

            if (mActorRecruit == null)
            {
                mActorRecruit = new SimScenarioFilter();
            }

            if (!mActorRecruit.Parse(row, manager, updater, prefix + "RecruitActor", false, ref error))
            {
                return(false);
            }

            if (mTargetRecruit == null)
            {
                mTargetRecruit = new SimScenarioFilter();
            }

            if (!mTargetRecruit.Parse(row, manager, updater, prefix + "RecruitTarget", false, ref error))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 protected FixItScenario(FixItScenario scenario)
     : base(scenario)
 {
     mName         = scenario.mName;
     mTargetFilter = scenario.mTargetFilter;
     mSuccess      = scenario.mSuccess;
 }
Exemplo n.º 3
0
 protected FixItScenario(FixItScenario scenario)
     : base (scenario)
 {
     mName = scenario.mName;
     mTargetFilter = scenario.mTargetFilter;
     mSuccess = scenario.mSuccess;
 }
Exemplo n.º 4
0
            private SimSelection(SimIDOption option)
                : base(option.Name, null, true, false)
            {
                mOption  = option;
                mScoring = option.GetScoring();

                AddColumn(new ScoringColumn(mScoring));
            }
Exemplo n.º 5
0
        protected virtual bool Allow(SimDescription me, SimScenarioFilter scoring)
        {
            if (!me.IsValidDescription)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 6
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));
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 public ScoringColumn(SimScenarioFilter scoring)
     : base("NRaas.StoryProgression.SimID:ScoreTitle", "NRaas.StoryProgression.SimID:ScoreTooltip", 40)
 {
     mScoring = scoring;
 }
Exemplo n.º 9
0
        public virtual bool Parse(XmlDbRow row, string prefix, bool firstPass, ref string error)
        {
            if ((!string.IsNullOrEmpty(prefix)) && (!Parse(row, null, false, ref error)))
            {
                return(false);
            }

            if (firstPass)
            {
                if (!row.Exists(prefix + "PropagateStory"))
                {
                    error = prefix + "PropagateStory missing";
                    return(false);
                }

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

            mName = row.GetString(prefix + "PropagateStory");

            if (row.Exists(prefix + "PropagateFocus"))
            {
                if (!ParserFunctions.TryParseEnum <WhichSim>(row.GetString(prefix + "PropagateFocus"), out mFocusSim, WhichSim.Target))
                {
                    error = prefix + "PropagateFocus unknown";
                    return(false);
                }
            }

            mChildName = row.GetString(prefix + "PropagateChildStory");

            mInitialReportChance  = row.GetInt(prefix + "PropagateInitialReportChance", row.GetInt(prefix + "PropagateReportChance", 10));
            mContinueReportChance = row.GetInt(prefix + "PropagateContinueReportChance", row.GetInt(prefix + "PropagateReportChance", 10));

            if (row.Exists(prefix + "PropagateBuff"))
            {
                if (!ParserFunctions.TryParseEnum <BuffNames>(row.GetString(prefix + "PropagateBuff"), out mBuff, BuffNames.Undefined))
                {
                    error = prefix + "PropagateBuff unknown";
                    return(false);
                }
            }

            if (row.Exists(prefix + "PropagateOrigin"))
            {
                if (!ParserFunctions.TryParseEnum <Origin>(row.GetString(prefix + "PropagateOrigin"), out mOrigin, Origin.None))
                {
                    error = prefix + "PropagateOrigin unknown";
                    return(false);
                }
            }

            Filter = new SimScenarioFilter();
            Filter.SetDisallowPartner(true);
            if (!Filter.Parse(row, Manager, this, prefix + "PropagateActor", firstPass, ref error))
            {
                return(false);
            }

            TargetFilter = new SimScenarioFilter();
            TargetFilter.SetDisallowPartner(true);
            if (!TargetFilter.Parse(row, Manager, this, prefix + "PropagateTarget", firstPass, ref error))
            {
                return(false);
            }

            return(true);
        }