diff --git a/src/ch/zhaw/catan/Bank.java b/src/ch/zhaw/catan/Bank.java index 5b0d0a4..39e7319 100644 --- a/src/ch/zhaw/catan/Bank.java +++ b/src/ch/zhaw/catan/Bank.java @@ -12,10 +12,8 @@ public class Bank { } - public void storeResourceToBank(List resourceToGive) { - for (Config.Resource resource : resourceToGive) { - resources.put(resource,resources.get(resource)+1); - } + public void storeResourceToBank(Config.Resource resource, int numberOfResources) { + resources.put(resource,resources.get(resource)+numberOfResources); } public boolean getResourceFromBank(Config.Resource resource,int numberOfResources) { diff --git a/src/ch/zhaw/catan/SiedlerGame.java b/src/ch/zhaw/catan/SiedlerGame.java index 24f534e..9f5c04f 100644 --- a/src/ch/zhaw/catan/SiedlerGame.java +++ b/src/ch/zhaw/catan/SiedlerGame.java @@ -86,11 +86,7 @@ public class SiedlerGame { private boolean substractResourceFromPlayer(Player player, Resource resource, int numberToSubstract){ if(player.substractResource(resource, numberToSubstract)){ - ArrayList resourcesForBank = new ArrayList<>(); - for(int i = 0; i < numberToSubstract; i++){ - resourcesForBank.add(resource); - } - bank.storeResourceToBank(resourcesForBank); + bank.storeResourceToBank(resource, numberToSubstract); return true; } return false;