Skip to content

Commit 7c67744

Browse files
committed
fix(plugin): fix round limit draw message
Fixes #259
1 parent cc15ce0 commit 7c67744

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

plugin/src/server/sc/plugin2020/Game.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public WinCondition checkWinCondition() {
171171
return new WinCondition(PlayerColor.BLUE, WinReason.BEE_FREE_FIELDS);
172172
} else {
173173
logger.info("Both Players have equal Points, no Winner");
174-
return new WinCondition(null, WinReason.BEE_FREE_FIELDS_EQUAL);
174+
return new WinCondition(null, WinReason.ROUND_LIMIT_EQUAL);
175175
}
176176
}
177177
return new WinCondition(PlayerColor.BLUE, WinReason.BEE_SURROUNDED);
@@ -192,9 +192,9 @@ public WinCondition checkWinCondition() {
192192
} else if(stats[PlayerColor.RED.getIndex()][Constants.GAME_STATS_ROUNDS] < stats[PlayerColor.BLUE.getIndex()][Constants.GAME_STATS_ROUNDS]) {
193193
winner = PlayerColor.BLUE;
194194
} else {
195-
return new WinCondition(null, WinReason.ROUND_LIMIT);
195+
return new WinCondition(null, WinReason.ROUND_LIMIT_EQUAL);
196196
}
197-
return new WinCondition(winner, WinReason.ROUND_LIMIT);
197+
return new WinCondition(winner, WinReason.ROUND_LIMIT_FREE_FIELDS);
198198
}
199199

200200
return null;

server/test/sc/server/plugins/TestGame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected void onRoundBasedAction(Player fromPlayer, ProtocolMessage data) {
3838
protected WinCondition checkWinCondition() {
3939
if (this.getRound() > 1) {
4040
logger.info("Someone won");
41-
return new WinCondition(((TestGameState) this.getCurrentState()).getState() % 2 == 0 ? PlayerColor.RED : PlayerColor.BLUE, WinReason.ROUND_LIMIT);
41+
return new WinCondition(((TestGameState) this.getCurrentState()).getState() % 2 == 0 ? PlayerColor.RED : PlayerColor.BLUE, WinReason.ROUND_LIMIT_FREE_FIELDS);
4242
}
4343
return null;
4444
}

socha-sdk/src/framework/sc/shared/WinReason.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
public enum WinReason {
44
BEE_SURROUNDED("Das Spiel ist beendet.\n%s hat die gegnerische Biene umzingelt."),
55
BEE_FREE_FIELDS("Das Spiel ist beendet.\n%s hat mehr freie Felder um seine Biene."),
6-
ROUND_LIMIT("Das Rundenlimit wurde erreicht.\n%s hat mehr freie Felder um seine Biene."),
7-
BEE_FREE_FIELDS_EQUAL("Das Rundenlimit wurde erreicht.\nBeide Bienen haben gleich viele freie Felder.");
6+
ROUND_LIMIT_FREE_FIELDS("Das Rundenlimit wurde erreicht.\n%s hat mehr freie Felder um seine Biene."),
7+
ROUND_LIMIT_EQUAL("Das Rundenlimit wurde erreicht.\nBeide Bienen haben gleich viele freie Felder.");
88

99
private final String message;
1010

0 commit comments

Comments
 (0)