예제 #1
0
파일: Bank.java 프로젝트: Zuwra/catan
 /**
  * @param rh
  * @throws BankException
  */
 public void setRC(ResourceHand rh) throws BankException {
   brick.setQuantity(rh.getBrick());
   ore.setQuantity(rh.getOre());
   wheat.setQuantity(rh.getWheat());
   wood.setQuantity(rh.getWood());
   sheep.setQuantity(rh.getSheep());
 }
예제 #2
0
파일: Bank.java 프로젝트: Zuwra/catan
 /**
  * @param rh a ResourceHand object
  * @throws BankException
  * @pre all attributes of the rh are non negative and do not exceed limits
  * @post all resource attributes are increased by their corresponding rh attribute.
  */
 public void modifyRC(ResourceHand rh) throws BankException {
   brick.modify(rh.getBrick());
   wheat.modify(rh.getWheat());
   ore.modify(rh.getOre());
   wood.modify(rh.getWood());
   sheep.modify(rh.getSheep());
 }
예제 #3
0
파일: Bank.java 프로젝트: Zuwra/catan
 /**
  * @param rh
  * @return
  */
 public boolean hasRC(ResourceHand rh) {
   if (ore.getQuantity() < rh.getOre()) return false;
   if (wood.getQuantity() < rh.getWood()) return false;
   if (sheep.getQuantity() < rh.getSheep()) return false;
   if (wheat.getQuantity() < rh.getWheat()) return false;
   if (brick.getQuantity() < rh.getBrick()) return false;
   return true;
 }