/*     */   public void addItem(Item itemAdded) {
/* 529 */     for (int i = 0; i < this.inventory.size(); i++) {
/* 530 */       Item item = (Item)this.inventory.get(i);
/* 531 */       if (item.name == itemAdded.name) {
/* 532 */         item.amount += itemAdded.amount;
/* 533 */         if (item.amount < 0) {
/* 534 */           item.amount = 0;
/* 535 */           itemAdded = null;
/*     */         }
/* 537 */         return;
/*     */       }
/*     */     }
/* 540 */     this.inventory.add(itemAdded);
/*     */   }