mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final2.git
synced 2024-11-08 18:00:37 +00:00
Only print buildable items that require a fireplace if one exists
This commit is contained in:
parent
63d160fd1b
commit
58f30fbf39
@ -98,13 +98,11 @@ wood
|
||||
wood
|
||||
wood
|
||||
axe
|
||||
ballon
|
||||
club
|
||||
fireplace
|
||||
hangglider
|
||||
sailingraft
|
||||
shack
|
||||
steamboat
|
||||
Error, need fireplace to build
|
||||
OK
|
||||
Error, already built
|
||||
|
@ -48,13 +48,11 @@ plastic
|
||||
plastic
|
||||
plastic
|
||||
axe
|
||||
ballon
|
||||
club
|
||||
fireplace
|
||||
hangglider
|
||||
sailingraft
|
||||
shack
|
||||
steamboat
|
||||
OK
|
||||
OK
|
||||
OK
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user