Пример #1
0
 public Tool(String name, decimal age, Worth baseWorth)
 {
     Name      = name;
     Age       = age;
     BaseWorth = baseWorth;
     InitEvent();
 }
Пример #2
0
 public Tool(String name)
 {
     Name      = name;
     Age       = 0;
     BaseWorth = new Worth(0, 0);
     InitEvent();
 }
Пример #3
0
        private void CalculateCurrentWorth()
        {
            if (Age != 0)
            {
                decimal tmp = _currentWorth.Price;
                _currentWorth.Price = _baseWorth.Price * _baseWorth.SentimentalValue * Age / 2;

                if (_currentWorth.Price > tmp && tmp != 0)
                {
                    ToolWorthIncreasedEvent(tmp, _currentWorth.Price);
                }
                _currentWorth.SentimentalValue = _baseWorth.SentimentalValue;
            }
            else
            {
                _currentWorth = BaseWorth;
            }
        }