diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/database/models/SaveStatus.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/database/models/SaveStatus.kt index 66d6562c..cfbb883c 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/database/models/SaveStatus.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/database/models/SaveStatus.kt @@ -7,7 +7,12 @@ import dev.lucasnlm.antimine.common.level.database.converters.SaveStatusConverte enum class SaveStatus( val code: Int ) { + // Not finished game. ON_GOING(0), + + // Finished game with victory. VICTORY(1), + + // Finished game with game over. DEFEAT(2) } diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldExt.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldExt.kt index d0bdcd22..b0566e98 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldExt.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/logic/MinefieldExt.kt @@ -3,7 +3,7 @@ package dev.lucasnlm.antimine.common.level.logic import dev.lucasnlm.antimine.common.level.models.Area import kotlin.math.absoluteValue -fun List.firstArea(id: Int) = this.first { it.id == id } +fun List.withId(id: Int) = this.first { it.id == id } fun List.filterNeighborsOf(area: Area) = this.filter { ((it.posX - area.posX).absoluteValue <= 1 && (it.posY - area.posY).absoluteValue <= 1) @@ -13,4 +13,4 @@ fun List.filterNotNeighborsOf(area: Area) = this.filter { ((it.posX - area.posX).absoluteValue > 1 || (it.posY - area.posY).absoluteValue > 1) } -fun List.filterNotNeighborsOf(areaIndex: Int) = this.filterNotNeighborsOf(this.firstArea(areaIndex)) +fun List.filterNotNeighborsOf(areaId: Int) = this.filterNotNeighborsOf(this.withId(areaId)) diff --git a/common/src/main/java/dev/lucasnlm/antimine/core/analytics/DebugAnalyticsManager.kt b/common/src/main/java/dev/lucasnlm/antimine/core/analytics/DebugAnalyticsManager.kt index b6c8a170..a26b9699 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/core/analytics/DebugAnalyticsManager.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/core/analytics/DebugAnalyticsManager.kt @@ -7,16 +7,18 @@ import dev.lucasnlm.antimine.core.analytics.models.Analytics class DebugAnalyticsManager : IAnalyticsManager { override fun setup(context: Context, properties: Map) { if (properties.isNotEmpty()) { - Log.d(TAG, "Setup Analytics using $properties") + Log.i(TAG, "Setup Analytics using $properties") } } override fun sentEvent(event: Analytics) { - if (event.extra.isNotEmpty()) { - Log.d(TAG, "Sent event: '${event.name}' with ${event.extra}") + val message = if (event.extra.isNotEmpty()) { + "Sent event: '${event.name}' with ${event.extra}" } else { - Log.d(TAG, "Sent event: '${event.name}'") + "Sent event: '${event.name}'" } + + Log.i(TAG, message) } companion object { diff --git a/common/src/main/java/dev/lucasnlm/antimine/core/control/GameControl.kt b/common/src/main/java/dev/lucasnlm/antimine/core/control/GameControl.kt index 1d9c4cc0..2f09d68c 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/core/control/GameControl.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/core/control/GameControl.kt @@ -106,12 +106,3 @@ sealed class GameControl( } } } - -/** - * A data class used to make feedback or analytics to an user action. - */ -data class ActionFeedback( - val actionResponse: ActionResponse?, - val index: Int, - val multipleChanges: Boolean -)