Пример #1
0
    public void Update(float amount)
    {
        _current += amount;

        if (_current < 0)
        {
            _current = 0;
        }
        else if (_current > _max)
        {
            _current = _max;
        }

        UpdateModifiers();
        OnCurrentChanged?.Invoke(this);

        if (_current <= 0f)
        {
            OnCurrentCritical?.Invoke(this);
        }
    }
Пример #2
0
 private void CurChannelButton_OnClick(object sender, RoutedEventArgs e)
 {
     IsCurrent = true;
     OnCurrentChanged?.Invoke();
     OnPropertyChanged(nameof(IsCurrent));
 }