コード例 #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);
        }
コード例 #2
0
ファイル: TakeItem.cs プロジェクト: MrHungerrr/EXaM
 public TakeItem(Scholar scholar, ScholarItem.Type item) : base(scholar)
 {
     _itemType = item;
 }
コード例 #3
0
 public bool Contains(ScholarItem.Type item)
 {
     return(_itemsIHave.Contains(item));
 }
コード例 #4
0
 public void Take(ScholarItem.Type item)
 {
     SetCurrentItem(item);
     CurrentItem.Show();
 }
コード例 #5
0
 public void AddItem(ScholarItem.Type item)
 {
     _itemsIHave.Add(item);
     OnItemsChanged?.Invoke();
 }