public void Koef(ZRSettings sets) { for (int i = 0; i < count; i++) { if (!sets.names.Contains(this.names[i])) { continue; } ZRValue val = this.values[i]; val.current += val.max * sets[this.names[i]].percent; //Debug.Log(this.names[i] + ":" + sets[this.names[i]].percent + ": " + sets[this.names[i]]); if (val.peaked) { val.Refresh(); } if (val.minimum) { val.Reset(); } if (this.names[i] == ZRSetting.Cage) { val.current = (int)val.current; //Debug.Log(val.ToString()); } } Init(); }
public void Replace(ZRSettings sets) { for (int i = 0; i < count; i++) { if (sets.names.Contains(this.names[i])) { this.values[i] = sets[this.names[i]]; } } }
public ZRSettings Clone() { ZRSettings setts = new ZRSettings(); for (int i = 0; i < count; i++) { setts.Add(names[i], values[i].Clone()); } setts.Init(); return(setts); }
public void Contact(ZRSettings sets) { for (int i = 0; i < sets.count; i++) { if (this.Contains(sets.names[i])) { continue; } this.Add(sets.names[i], sets.values[i]); } }
public void Multyply(ZRSettings sets) { for (int i = 0; i < count; i++) { if (sets.names.Contains(this.names[i])) { this.values[i] *= sets[this.names[i]].percent; } } Init(); }
public static ZRSettings operator /(ZRSettings one, float value) { ZRSettings settings = new ZRSettings(); for (int i = 0; i < one.count; i++) { settings.Add(one.names[i], one.values[i] / value); } settings.Init(); return(settings); }
public void Addition(ZRSettings sets) { for (int i = 0; i < count; i++) { if (sets.names.Contains(this.names[i])) { ZRValue val = this.values[i] * sets[this.names[i]].percent; if (this.names[i] == ZRSetting.Cage) { val.ToInt(); } this.values[i] += val; } } Init(); }
public static ZRSettings operator -(ZRSettings one, ZRSettings two) { ZRSettings settings = new ZRSettings(); for (int i = 0; i < one.count; i++) { if (!settings.Contains(one.names[i])) { settings.Add(one.names[i], new ZRValue(0)); } settings[one.names[i]] = one.values[i] - two[one.names[i]]; } for (int i = 0; i < two.count; i++) { if (settings.Contains(two.names[i])) { continue; } settings.Add(two.names[i], two.values[i] * (-1)); } settings.Init(); return(settings); }