public override void SetValue(int i, int j, T value) { if (i < 0 || j < 0) { throw new ArgumentException("Индекс не может быть меньше нуля."); } if (i > Size || j > Size) { throw new ArgumentException("Индекс не может выходить за пределы матрицы"); } if (value == null) { throw new ArgumentNullException(nameof(value)); } if (i != j) { throw new InvalidOperationException("Матрица содержит значения по умолчанию за пределами главной диагонали"); } diagonalElements[i] = value; OnChangeValue?.Invoke(i, j, value); }
public override void SetValue(int i, int j, T value) { if (i < 0 || j < 0) { throw new ArgumentException("Index of element can't be less then zero."); } if (i > Size || j > Size) { throw new ArgumentException("Index of element can't be greater then size of matrix."); } if (value == null) { throw new ArgumentNullException(nameof(value)); } if (i != j) { throw new ArgumentException("You can't change non-diagonal element of matrix. You need to change both symmetric values."); } elements[i][j] = value; OnChangeValue?.Invoke(i, j, value); }
public void ChangeValue() { this.Value++; OnChangeValue.SafeInvoke(this.Value); }
public void SetBool(string key, bool value) { Api.SetBool(key, value); OnChangeValue?.Invoke(key, value); }
public void DeleteKey(string key) { Api.RemoveKey(key); OnChangeValue?.Invoke(key, null); }
public void DeleteAll() { Api.Clear(); OnChangeValue?.Invoke("", null); }
public void SetString(string key, string value) { Api.SetString(key, value); OnChangeValue?.Invoke(key, value); }
public void SetFloat(string key, float value) { Api.SetFloat(key, value); OnChangeValue?.Invoke(key, value); }
public void SetInt(string key, int value) { Api.SetInt(key, value); OnChangeValue?.Invoke(key, value); }