コード例 #1
0
ファイル: IntegerOption.cs プロジェクト: yakoder/NRaas
            public void UpdateManager(StoryProgressionObject manager)
            {
                if (mOption == null)
                {
                    return;
                }

                mOption = manager.GetOption <IntegerOption>(mOption.GetTitlePrefix());
            }
コード例 #2
0
ファイル: WeightScenarioHelper.cs プロジェクト: yakoder/NRaas
        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));
                }
            }
        }
コード例 #3
0
ファイル: IntegerOption.cs プロジェクト: yakoder/NRaas
            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);
            }
コード例 #4
0
ファイル: IntegerOption.cs プロジェクト: yakoder/NRaas
 public ValueTest(IntegerOption option, int min, int max)
 {
     mOption  = option;
     mMinimum = min;
     mMaximum = max;
 }
コード例 #5
0
ファイル: IntegerOption.cs プロジェクト: yakoder/NRaas
 public OptionValue(IntegerOption option, int value)
 {
     mOption = option;
     mValue  = value;
 }
コード例 #6
0
ファイル: IntegerOption.cs プロジェクト: yakoder/NRaas
 public ResetValue(IntegerOption option)
 {
     mOption = option;
 }