You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val fields:Collection<Field> = getOwnFields(state.board, state.getCurrentPlayerColor())
21
+
val fields:Collection<Field> = getOwnFields(state.board, state.getCurrentTeam())
21
22
for(field in fields) {
22
23
for(direction inDirection.values()) {
23
24
val x = field.x
@@ -32,7 +33,7 @@ class GameRuleLogic private constructor() {
32
33
} catch(ignore:InvalidMoveException) {
33
34
/**TODO PiranhaMoveMistake for InvalidMoveException? because InvalidMoveException
34
35
* is missing in skd shared
35
-
*/
36
+
*/
36
37
}
37
38
}
38
39
}
@@ -47,11 +48,11 @@ class GameRuleLogic private constructor() {
47
48
direction:Direction,
48
49
distance:Int
49
50
): Boolean {
50
-
if(x >= Constants.BOARD_SIZE || y >= Constants.BOARD_SIZE || x < 0 || y < 0) throw InvalidMoveException("x or y are not within the field range")
51
+
if(x >=PiranhaConstants.BOARD_LENGTH|| y >=PiranhaConstants.BOARD_LENGTH|| x <0|| y <0) throwInvalidMoveException("x or y are not within the field range")
51
52
val board = state.board
52
53
val curField:Field= board.getField(x, y)
53
-
val curFieldPlayer: java.util.Optional<PlayerColor> = curField.piranha
0 commit comments