public void UpdateManager(StoryProgressionObject manager) { if (mOption == null) { return; } mOption = manager.GetOption <IntegerOption>(mOption.GetTitlePrefix()); }
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)); } } }
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); }
public ValueTest(IntegerOption option, int min, int max) { mOption = option; mMinimum = min; mMaximum = max; }
public OptionValue(IntegerOption option, int value) { mOption = option; mValue = value; }
public ResetValue(IntegerOption option) { mOption = option; }