summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e0290aa)
(authored months ago, had remained WIP in my work directory
for "some" reason)
p1.adjustScore(trollPosition);
}
p1.adjustScore(trollPosition);
}
+ boolean FIX_IT() {
+ switch (league.fixLevel) {
+ case SOMETIMES: return random.nextInt(10) > 0;
+ case NEVER: return false;
+ default: throw new JavaLimitationError();
+ }
+ }
+
private Integer winner;
boolean haveWinner() {
return winner != null;
private Integer winner;
boolean haveWinner() {
return winner != null;
case Throw:
try { player.model.consumeStones(player.stoneThrow); }
catch (Model.Player.ThrewMoreStonesThanHad e) {
case Throw:
try { player.model.consumeStones(player.stoneThrow); }
catch (Model.Player.ThrewMoreStonesThanHad e) {
- boolean FIX_IT;
- switch (league.fixLevel) {
- case SOMETIMES:
- FIX_IT = model.random.nextInt(10) > 0;
- break;
- case NEVER:
- FIX_IT = false;
- break;
- default: throw new JavaLimitationError();
- }
- if (FIX_IT) {
player.view.threwMoreStonesThanHad();
player.stoneThrow = player.model.consumeMaxStones();
}
player.view.threwMoreStonesThanHad();
player.stoneThrow = player.model.consumeMaxStones();
}
}
}
catch (Model.Player.FailedToThrowStonesAndShouldHave e) {
}
}
catch (Model.Player.FailedToThrowStonesAndShouldHave e) {
- boolean FIX_IT;
- switch (league.fixLevel) {
- case SOMETIMES:
- FIX_IT = model.random.nextInt(10) > 0;
- break;
- case NEVER:
- FIX_IT = false;
- break;
- default: throw new JavaLimitationError();
- }
- if (FIX_IT) {
player.view.failedToThrowStonesAndShouldHave();
player.stoneThrow = player.model.consumeMinStones();
}
player.view.failedToThrowStonesAndShouldHave();
player.stoneThrow = player.model.consumeMinStones();
}