diff --git a/game1_output.txt b/game1_output.txt index 82961c8..73cf9cc 100644 --- a/game1_output.txt +++ b/game1_output.txt @@ -98,13 +98,11 @@ wood wood wood axe -ballon club fireplace hangglider sailingraft shack -steamboat Error, need fireplace to build OK Error, already built diff --git a/game2_output.txt b/game2_output.txt index b2f0841..87efd12 100644 --- a/game2_output.txt +++ b/game2_output.txt @@ -48,13 +48,11 @@ plastic plastic plastic axe -ballon club fireplace hangglider sailingraft shack -steamboat OK OK OK diff --git a/src/edu/kit/informatik/model/CardGame.java b/src/edu/kit/informatik/model/CardGame.java index 5116c96..0eeb1ae 100644 --- a/src/edu/kit/informatik/model/CardGame.java +++ b/src/edu/kit/informatik/model/CardGame.java @@ -151,6 +151,9 @@ public class CardGame { } private boolean canBuild(Item item) { + if (item.requiresFireplace() && !items.contains(FIREPLACE)) { + return false; + } final Card[] resourcesNeeded = item.resourcesNeeded(); for (final Card resource : resources) { for (int j = 0; j < resourcesNeeded.length; j++) {