public override void SetValueInfo(AffixValueInfo info) { if (!(info.BaseValueMin is AffixValueMultiple)) { throw new ArgumentException($"Info needs to be of type AffixValueMultiple!"); } originalInfo = info; // First clear all exisiting inputs while (inputs.Count > 0) { RemoveInput(inputs.Count - 1); } var min = info.BaseValueMin as AffixValueMultiple; var max = info.BaseValueMax as AffixValueMultiple; for (int i = 0; i < min.Count; i++) { if (!(min[i] is AffixValueSingle) && !(min[i] is AffixValueRange)) { throw new ArgumentException($"Info contains affix values other than single or range!"); } GameObject prefab = min[i] is AffixValueSingle ? singleInputPrefab : rangeInputPrefab; AddInput(i, prefab); var input = inputs.Last(); input.SetValueInfo(new AffixValueInfo(min[i], max[i], info.Progressions[i])); } UpdateIsChanged(); }
public override void SetValueInfo(AffixValueInfo info) { if (!(info.BaseValueMin is AffixValueRange)) { throw new ArgumentException("Can only display AffixValueRange info!", nameof(info)); } MinimumInput.SetValueInfo(info.BaseValueMin as AffixValueRange); MaximumInput.SetValueInfo(info.BaseValueMax as AffixValueRange); MinimumInput.Progression = info.Progression; UpdateIsChanged(); }
public void SetInfo(AffixValueInfo info) { if (ReferenceEquals(info, currentInfo)) { return; } currentInfo = info; Type type = info.BaseValueMin.GetType(); UpdateValueDisplay(type); input.SetValueInfo(info); TypeDropdown.value = TypeDropdown.options.FindIndex(option => option.text == type.Name.Remove(0, "AffixValue".Length)); previousType = TypeDropdown.value; }
public override void SetValueInfo(AffixValueInfo info) { if (!(info.BaseValueMin is AffixValueSingle)) { throw new ArgumentException($"Can only display AffixValueSingle info!", nameof(info)); } originalMinimum = info.BaseValueMin as AffixValueSingle; originalMaximum = info.BaseValueMax as AffixValueSingle; MinimumInput.text = originalMinimum.ToString(); MaximumInput.text = originalMaximum.ToString(); Progression = info.Progression; UpdateIsMaximumChanged(MaximumInput.text); UpdateIsMinimumChanged(MinimumInput.text); UpdateIsProgressionChanged(); }
private void SaveAffixInfoButton_Click(object sender, EventArgs e) { AffixProgression newProgression = new AffixProgression(localProgressionFunctionName, localProgressionParameters); AffixValueInfo newValueInfo = null; if (localValueType == AffixValueType.SingleValue) { newValueInfo = new AffixValueInfo(localBaseValueMinSingle, localBaseValueMaxSingle, newProgression); } else if (localValueType == AffixValueType.Range) { newValueInfo = new AffixValueInfo(localBaseValueMinRange, localBaseValueMaxRange, newProgression); } AffixInfo newInfo = new AffixInfo(localValueType, localName, newValueInfo, localDescription); Serializer.SaveAffixInfoToDisk(newInfo); AffixInfo.Register(newInfo); currentInfo = newInfo; UpdateAllLabels(); }
public AffixValueInfo(AffixValueInfo src) : this(src.BaseValueMin, src.BaseValueMax, src.Progressions) { }
private AffixInfo(AffixValueInfo valueInfo, string description) { Description = description; ValueInfo = new AffixValueInfo(valueInfo); }
public AffixInfo(AffixType type, AffixValueInfo valueInfo, string description) : this(valueInfo, description) { Type = type; }
/// <summary> /// Creates a new AffixInfo object and its associated type /// </summary> public AffixInfo(int id, string name, AffixValueInfo valueInfo, string description) : this(AffixType.Replace(id, name), valueInfo, description) { }
/// <summary> /// Creates a new AffixInfo object and its associated type /// </summary> public AffixInfo(string name, AffixValueInfo valueInfo, string description) : this(AffixType.CreateNew(name), valueInfo, description) { }
/// <summary> /// Creates a new AffixInfo object and its associated type /// </summary> public AffixInfo(string name, AffixValueInfo valueInfo) : this(name, valueInfo, "") { }
public abstract void SetValueInfo(AffixValueInfo info);