mirror of
https://gitlab.com/arnekeller/kit-programmieren-ws1920-final2.git
synced 2024-11-08 09:50:38 +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
|
spider
|
||||||
Error, roll dice, please
|
Error, roll dice, please
|
||||||
wood
|
wood
|
||||||
Error, could not build item
|
Error, awaiting dice roll, can not build
|
||||||
Error, unknown command
|
Error, unknown command
|
||||||
EMPTY
|
EMPTY
|
||||||
Error, can not get buildable items: awaiting dice roll
|
Error, can not get buildable items: awaiting dice roll
|
||||||
@ -38,7 +38,7 @@ survived
|
|||||||
snake
|
snake
|
||||||
Error, roll dice, please
|
Error, roll dice, please
|
||||||
wood
|
wood
|
||||||
Error, could not build item
|
Error, awaiting dice roll, can not build
|
||||||
Error, unknown command
|
Error, unknown command
|
||||||
EMPTY
|
EMPTY
|
||||||
Error, can not get buildable items: awaiting dice roll
|
Error, can not get buildable items: awaiting dice roll
|
||||||
@ -48,7 +48,7 @@ survived
|
|||||||
tiger
|
tiger
|
||||||
Error, roll dice, please
|
Error, roll dice, please
|
||||||
wood
|
wood
|
||||||
Error, could not build item
|
Error, awaiting dice roll, can not build
|
||||||
Error, unknown command
|
Error, unknown command
|
||||||
EMPTY
|
EMPTY
|
||||||
Error, can not get buildable items: awaiting dice roll
|
Error, can not get buildable items: awaiting dice roll
|
||||||
@ -166,16 +166,16 @@ sailingraft
|
|||||||
shack
|
shack
|
||||||
steamboat
|
steamboat
|
||||||
spider
|
spider
|
||||||
<e
|
Error, awaiting dice roll, can not build
|
||||||
<e
|
Error, can not get buildable items: awaiting dice roll
|
||||||
survived
|
survived
|
||||||
OK
|
OK
|
||||||
spider
|
spider
|
||||||
<e
|
Error, awaiting dice roll, can not build
|
||||||
<e
|
Error, can not get buildable items: awaiting dice roll
|
||||||
survived
|
survived
|
||||||
OK
|
OK
|
||||||
spider
|
spider
|
||||||
<e
|
Error, awaiting dice roll, can not build
|
||||||
<e
|
Error, can not get buildable items: awaiting dice roll
|
||||||
survived
|
survived
|
||||||
|
@ -112,6 +112,8 @@ public class CardGame {
|
|||||||
public String build(Item item) throws LogicException {
|
public String build(Item item) throws LogicException {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
throw new LogicException("can not build item");
|
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)) {
|
} else if (item.requiresFireplace() && !items.contains(FIREPLACE)) {
|
||||||
throw new LogicException("need fireplace to build");
|
throw new LogicException("need fireplace to build");
|
||||||
} else if (items.contains(item)) {
|
} else if (items.contains(item)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user