X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/e0290aa2bf6fe6c998d30101fcad648baa2cfcd5..ee0b3a350bf74952ace849ec105866675c91db5c:/src/main/java/com/codingame/game/Referee.java diff --git a/src/main/java/com/codingame/game/Referee.java b/src/main/java/com/codingame/game/Referee.java index 7a718e9..8f5fc97 100644 --- a/src/main/java/com/codingame/game/Referee.java +++ b/src/main/java/com/codingame/game/Referee.java @@ -81,17 +81,7 @@ public class Referee extends AbstractReferee { 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) { + if (model.FIX_IT()) { player.view.threwMoreStonesThanHad(); player.stoneThrow = player.model.consumeMaxStones(); } @@ -102,17 +92,7 @@ public class Referee extends AbstractReferee { } } 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) { + if (model.FIX_IT()) { player.view.failedToThrowStonesAndShouldHave(); player.stoneThrow = player.model.consumeMinStones(); }