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
|
||||||
wood
|
wood
|
||||||
axe
|
axe
|
||||||
ballon
|
|
||||||
club
|
club
|
||||||
fireplace
|
fireplace
|
||||||
hangglider
|
hangglider
|
||||||
sailingraft
|
sailingraft
|
||||||
shack
|
shack
|
||||||
steamboat
|
|
||||||
Error, need fireplace to build
|
Error, need fireplace to build
|
||||||
OK
|
OK
|
||||||
Error, already built
|
Error, already built
|
||||||
|
@ -48,13 +48,11 @@ plastic
|
|||||||
plastic
|
plastic
|
||||||
plastic
|
plastic
|
||||||
axe
|
axe
|
||||||
ballon
|
|
||||||
club
|
club
|
||||||
fireplace
|
fireplace
|
||||||
hangglider
|
hangglider
|
||||||
sailingraft
|
sailingraft
|
||||||
shack
|
shack
|
||||||
steamboat
|
|
||||||
OK
|
OK
|
||||||
OK
|
OK
|
||||||
OK
|
OK
|
||||||
|
@ -151,6 +151,9 @@ public class CardGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean canBuild(Item item) {
|
private boolean canBuild(Item item) {
|
||||||
|
if (item.requiresFireplace() && !items.contains(FIREPLACE)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final Card[] resourcesNeeded = item.resourcesNeeded();
|
final Card[] resourcesNeeded = item.resourcesNeeded();
|
||||||
for (final Card resource : resources) {
|
for (final Card resource : resources) {
|
||||||
for (int j = 0; j < resourcesNeeded.length; j++) {
|
for (int j = 0; j < resourcesNeeded.length; j++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user