private void IncreaseButton_Click(object sender, RoutedEventArgs e)
        {
            Value = (Value + 1) > MaxValue ? MaxValue : Value + 1;
            if (Value == MaxValue)
            {
                IncreaseButton.IsEnabled = false;
            }
            else
            {
                DecreaseButton.IsEnabled = true;
            }

            OnIncrease?.Invoke();
        }
Exemple #2
0
        public void Increase(string classname, int amount = 1)
        {
            if (amount == 0)
            {
                return;
            }

            if (!items.TryGetValue(classname, out InventoryItemModel item))
            {
                item = new InventoryItemModel(classname, amount);
                items.Add(classname, item);
            }
            else
            {
                item.Increase(amount);
            }

            OnIncrease?.Invoke(item, items[classname].Amount, amount, items[classname].Amount - amount == 0);
        }
Exemple #3
0
 public void Increase(int x) =>
 OnIncrease?.Invoke(this, new IsIncreasedEventsArgs(x));
Exemple #4
0
 internal void Increase(int amount)
 {
     Amount += amount;
     OnIncrease?.Invoke(this, Amount, amount);
 }