Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object GameRuleLogic {
* @return wie viele Felder weit der Zug sein sollte */
@JvmStatic
fun movementDistance(board: Board, move: Move): Int {
var count = 1
var count = 0
var pos = move.from
while(true) {
pos += move.direction
Expand All @@ -32,6 +32,14 @@ object GameRuleLogic {
count++
}
}

pos = move.from
val field = board.getOrNull(pos)
if(field?.team != null) {
count++
}


return count
}

Expand Down
Loading