Ejemplo n.º 1
0
            public void UpdateManager(StoryProgressionObject manager)
            {
                if (mOption == null)
                {
                    return;
                }

                mOption = manager.GetOption <IntegerOption>(mOption.GetTitlePrefix());
            }
Ejemplo n.º 2
0
        public void UpdateManager(StoryProgressionObject manager)
        {
            mAccumulatorOptions = new List <SimPersonality.IAccumulatorValue>();

            foreach (AccumulatorLoadValue name in mAccumulators)
            {
                IntegerOption option = manager.GetOption <IntegerOption>(name.mName);
                if (option == null)
                {
                    continue;
                }

                if (name.mReset)
                {
                    mAccumulatorOptions.Add(new IntegerOption.ResetValue(option));
                }
                else
                {
                    mAccumulatorOptions.Add(new IntegerOption.OptionValue(option, name.mValue));
                }
            }

            mGatheringFailAccumulatorOptions = new List <SimPersonality.IAccumulatorValue>();

            foreach (AccumulatorLoadValue name in mGatheringFailAccumulators)
            {
                IntegerOption option = manager.GetOption <IntegerOption>(name.mName);
                if (option == null)
                {
                    continue;
                }

                if (name.mReset)
                {
                    mGatheringFailAccumulatorOptions.Add(new IntegerOption.ResetValue(option));
                }
                else
                {
                    mGatheringFailAccumulatorOptions.Add(new IntegerOption.OptionValue(option, name.mValue));
                }
            }
        }
Ejemplo n.º 3
0
            public bool Parse(XmlDbRow row, string name, StoryProgressionObject manager, IUpdateManager updater, ref string error)
            {
                string value = row.GetString(name);

                if (string.IsNullOrEmpty(value))
                {
                    error = "IntegerOption " + name + " missing";
                    return(false);
                }

                if (!int.TryParse(value, out mValue))
                {
                    mOption = manager.GetOption <IntegerOption>(value);
                    if (mOption == null)
                    {
                        error = "IntegerOption " + value + " invalid";
                        return(false);
                    }
                }

                updater.AddUpdater(this);
                return(true);
            }
Ejemplo n.º 4
0
 public ValueTest(IntegerOption option, int min, int max)
 {
     mOption  = option;
     mMinimum = min;
     mMaximum = max;
 }
Ejemplo n.º 5
0
 public OptionValue(IntegerOption option, int value)
 {
     mOption = option;
     mValue  = value;
 }
Ejemplo n.º 6
0
 public ResetValue(IntegerOption option)
 {
     mOption = option;
 }