diff --git a/src/ch/zhaw/catan/Bank.java b/src/ch/zhaw/catan/Bank.java index 2bb84d7..f44482d 100644 --- a/src/ch/zhaw/catan/Bank.java +++ b/src/ch/zhaw/catan/Bank.java @@ -1,13 +1,14 @@ package ch.zhaw.catan; +import java.util.HashMap; import java.util.List; import java.util.Map; public class Bank { - private Map resources; + private HashMap resources; public Bank(){ - resources = Config.INITIAL_RESOURCE_CARDS_BANK; + resources.putAll(Config.INITIAL_RESOURCE_CARDS_BANK); } @@ -27,17 +28,4 @@ public class Bank { return false; } } - - public boolean tradeWithBank(Config.Resource resourceToReceive, Config.Resource resourceToGive, int toWant, int toGive) { - if(resources.get(resourceToReceive) >= toWant){ - Integer newResourceReceived = resources.get(resourceToReceive) + toGive; - Integer newResourcesGiven = resources.get(resourceToGive) - toWant; - resources.put(resourceToReceive, newResourceReceived); - resources.put(resourceToGive, newResourcesGiven); - return true; - } - else{ - return false; - } - } }