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); }
public TakeItem(Scholar scholar, ScholarItem.Type item) : base(scholar) { _itemType = item; }
public bool Contains(ScholarItem.Type item) { return(_itemsIHave.Contains(item)); }
public void Take(ScholarItem.Type item) { SetCurrentItem(item); CurrentItem.Show(); }
public void AddItem(ScholarItem.Type item) { _itemsIHave.Add(item); OnItemsChanged?.Invoke(); }