public void ApplyModification(IntModification mod, Sheet sheet) { switch (mod.modType) { default: throw new Exception("unhandled IntModificationType"); case IntModificationType.Delta: modifier += mod.GetValue(sheet); break; case IntModificationType.Absolute: modifier = mod.GetValue(sheet); break; } if (modType != IntModificationType.Absolute) { modType = mod.modType; } }
public void Reset() { modifier = 0; modType = IntModificationType.Delta; }
public IntModification(List <string> _path, int _baseValue, string _query, IntModificationType _modType) : base(_path) { modType = _modType; baseValue = _baseValue; query = Regex.Replace(_query, @"\s+", ""); //no whitespace allowed, to make things easier for us during querying }