Esempio n. 1
0
        private void SetCurrentItem(ScholarItem.Type item)
        {
            if (!_itemsIHave.Contains(item))
            {
                throw new Exception($"У нас нет {item}!");
            }

            if (AmIHolding)
            {
                throw new Exception($"Мы еще держим {CurrentItem}!");
            }

            CurrentItem = ScholarItem.Create(_scholar, item);
        }
Esempio n. 2
0
 public TakeItem(Scholar scholar, ScholarItem.Type item) : base(scholar)
 {
     _itemType = item;
 }
Esempio n. 3
0
 public bool Contains(ScholarItem.Type item)
 {
     return(_itemsIHave.Contains(item));
 }
Esempio n. 4
0
 public void Take(ScholarItem.Type item)
 {
     SetCurrentItem(item);
     CurrentItem.Show();
 }
Esempio n. 5
0
 public void AddItem(ScholarItem.Type item)
 {
     _itemsIHave.Add(item);
     OnItemsChanged?.Invoke();
 }