Fix long press issue with auto-flag
This commit is contained in:
parent
eede5b9494
commit
9825ed6159
2 changed files with 4 additions and 5 deletions
|
@ -81,8 +81,6 @@ class LevelFacade {
|
|||
|
||||
fun hasMarkOn(index: Int): Boolean = getArea(index).mark != Mark.None
|
||||
|
||||
fun hasMineOn(index: Int): Boolean = getArea(index).hasMine
|
||||
|
||||
fun plantMinesExcept(index: Int, includeSafeArea: Boolean = false) {
|
||||
plantRandomMines(index, includeSafeArea)
|
||||
putMinesTips()
|
||||
|
|
|
@ -176,6 +176,10 @@ class GameViewModel(
|
|||
field.postValue(levelFacade.field.toList())
|
||||
}
|
||||
|
||||
if (preferencesRepository.useFlagAssistant() && !levelFacade.hasAnyMineExploded()){
|
||||
levelFacade.runFlagAssistant()
|
||||
}
|
||||
|
||||
refreshGameStatus()
|
||||
analyticsManager.sentEvent(Event.PressArea(index))
|
||||
}
|
||||
|
@ -189,9 +193,6 @@ class GameViewModel(
|
|||
eventObserver.postValue(GameEvent.GameOver)
|
||||
}
|
||||
else -> {
|
||||
if (preferencesRepository.useFlagAssistant()){
|
||||
levelFacade.runFlagAssistant()
|
||||
}
|
||||
eventObserver.postValue(GameEvent.Running)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue