mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final2.git
synced 2024-11-24 01:15:03 +00:00
Only build items when not expecting dice roll
This commit is contained in:
parent
1e95394391
commit
e7c3a40ac0
@ -28,7 +28,7 @@ wood
|
||||
spider
|
||||
Error, roll dice, please
|
||||
wood
|
||||
Error, could not build item
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, unknown command
|
||||
EMPTY
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
@ -38,7 +38,7 @@ survived
|
||||
snake
|
||||
Error, roll dice, please
|
||||
wood
|
||||
Error, could not build item
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, unknown command
|
||||
EMPTY
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
@ -48,7 +48,7 @@ survived
|
||||
tiger
|
||||
Error, roll dice, please
|
||||
wood
|
||||
Error, could not build item
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, unknown command
|
||||
EMPTY
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
@ -166,16 +166,16 @@ sailingraft
|
||||
shack
|
||||
steamboat
|
||||
spider
|
||||
<e
|
||||
<e
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
survived
|
||||
OK
|
||||
spider
|
||||
<e
|
||||
<e
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
survived
|
||||
OK
|
||||
spider
|
||||
<e
|
||||
<e
|
||||
Error, awaiting dice roll, can not build
|
||||
Error, can not get buildable items: awaiting dice roll
|
||||
survived
|
||||
|
@ -112,6 +112,8 @@ public class CardGame {
|
||||
public String build(Item item) throws LogicException {
|
||||
if (item == null) {
|
||||
throw new LogicException("can not build item");
|
||||
} else if (awaitingDiceRoll()) {
|
||||
throw new LogicException("awaiting dice roll, can not build");
|
||||
} else if (item.requiresFireplace() && !items.contains(FIREPLACE)) {
|
||||
throw new LogicException("need fireplace to build");
|
||||
} else if (items.contains(item)) {
|
||||
|
Loading…
Reference in New Issue
Block a user