Exemplo n.º 1
0
        private void SetItemsUi()
        {
            IItemIterator iterator = _inventory.GetIterator();

            for (iterator.First(); iterator.IsDone(); iterator.Next())
            {
                _inventoryUi.SetItem(iterator.CurrentItem().GetItemUi(), iterator.CurrentItem().GetIdentifier());
            }
        }
Exemplo n.º 2
0
        public void SetInventoryUi(IInventoryUi inventoryUi)
        {
            _inventoryUi = inventoryUi;
            _inventoryUi.SetInventory(this);
            IItemIterator itemIterator = _itemsRepository.GetIterator();

            for (itemIterator.First(); itemIterator.IsDone(); itemIterator.Next())
            {
                _inventoryUi.SetItem(itemIterator.CurrentItem().GetItemUi(), itemIterator.CurrentItem().GetIdentifier());
            }
        }
Exemplo n.º 3
0
 public void AddItem(Item item)
 {
     if (_inventorySize > _inventoryCapacity)
     {
         return;
     }
     ++_inventorySize;
     item.SetIdentifier(new Identifier());
     _itemsRepository.AddItem(item);
     item.PickUp();
     _inventoryUi.SetItem(item.GetItemUi(), item.GetIdentifier());
 }