Rename method

This commit is contained in:
Lucas Lima 2020-07-15 22:30:15 -03:00 committed by Lucas Lima
parent e85d94ff96
commit a94bb545b3
No known key found for this signature in database
GPG key ID: 0259A3F43EC1027A
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@ class GameController {
}
}
ActionResponse.OpenNeighbors -> {
minefieldHandler.openNeighborsOf(target.id)
minefieldHandler.openOrFlagNeighborsOf(target.id)
}
}

View file

@ -76,7 +76,7 @@ class MinefieldHandler(
}
}
fun openNeighborsOf(index: Int) {
fun openOrFlagNeighborsOf(index: Int) {
field.getOrNull(index)?.run {
val neighbors = field.filterNeighborsOf(this)
val flaggedCount = neighbors.count { it.mark.isFlag() }