Exemplo n.º 1
0
 public void update() {
   if (backpackStock != null && backpackStock == -1) {
     stockLabel.setText(stock.getStock().toString());
     price.setText("$" + ((Float) (1.1f * stock.getPrice())).toString());
   } else if (pack.getContents().get(item) != null) {
     stockLabel.setText(pack.getContents().get(item).toString());
     price.setText("$" + ((Float) (0.9f * stock.getPrice())).toString());
   }
 }
Exemplo n.º 2
0
 /** @return stock of item */
 public Integer getStock() {
   if (backpackStock != null && backpackStock == -1) {
     return stock.getStock();
   }
   return pack.getContents().get(item);
 }