Пример #1
0
        public void Add(int amount)
        {
            if (Amount + amount <= MaxAmount)
            {
                Amount += amount;
            }
            else
            {
                Amount = MaxAmount;
            }

            EnergySuiteManager.OnAmountChanged(Amount, this);
        }
Пример #2
0
        public bool Use(int amount)
        {
            if (Amount - amount >= 0)
            {
                Amount -= amount;
            }
            else
            {
                return(false);
            }

            EnergySuiteManager.OnAmountChanged(Amount, this);
            return(true);
        }