diff --git a/android/gradle.properties b/android/gradle.properties index aa51064abebb79ba519e600afb7af23779154d4e..135006f9c1386c8757595c43e890e911f732f5a3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.5 -app.versionCode=5 +app.versionName=0.0.6 +app.versionCode=6 diff --git a/fastlane/metadata/android/en-US/changelogs/6.txt b/fastlane/metadata/android/en-US/changelogs/6.txt new file mode 100644 index 0000000000000000000000000000000000000000..26452b2eb60f242a2c424b03592ea683a052aabd --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/6.txt @@ -0,0 +1 @@ +Fix grab seeds. diff --git a/fastlane/metadata/android/fr-FR/changelogs/6.txt b/fastlane/metadata/android/fr-FR/changelogs/6.txt new file mode 100644 index 0000000000000000000000000000000000000000..087e6fa6a6091c732beb0edc25201eb489e06a20 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/6.txt @@ -0,0 +1 @@ +Correction sur ramassage des graines. diff --git a/lib/cubit/game_cubit.dart b/lib/cubit/game_cubit.dart index c41a09b636faa4bc824ba6ffed00de0607637e7b..0cc2123da83e8389b6a58c0f174d381611ab53f8 100644 --- a/lib/cubit/game_cubit.dart +++ b/lib/cubit/game_cubit.dart @@ -107,7 +107,7 @@ class GameCubit extends HydratedCubit<GameState> { refresh(); final int lastCellIndex = await animateSeedsDistribution(cellIndex); - animateSeedsEarning(lastCellIndex); + await animateSeedsEarning(lastCellIndex); toggleCurrentPlayer(); @@ -148,9 +148,11 @@ class GameCubit extends HydratedCubit<GameState> { return cellIndex; } - void animateSeedsEarning(int lastCellIndex) async { + Future<int> animateSeedsEarning(int lastCellIndex) async { printlog('animateSeedsEarning / lastCellIndex: $lastCellIndex'); + int earnedSeedsCount = 0; + if (state.currentGame.isOpponentHouse(lastCellIndex)) { final int seedsCount = state.currentGame.board.cells[lastCellIndex]; printlog('found $seedsCount seed(s) on final house'); @@ -160,17 +162,21 @@ class GameCubit extends HydratedCubit<GameState> { state.currentGame.board.cells[lastCellIndex] = 0; state.currentGame.scores[state.currentGame.currentPlayer] += seedsCount; + earnedSeedsCount += seedsCount; refresh(); await Future.delayed(const Duration(milliseconds: 500)); // (recursively) check previous cells printlog('-> dispatch to previous cell'); - animateSeedsEarning(state.currentGame.getPreviousCellIndex(lastCellIndex)); + final int previousCellIndex = state.currentGame.getPreviousCellIndex(lastCellIndex); + earnedSeedsCount += await animateSeedsEarning(previousCellIndex); } else { printlog('-> nothing to do'); } } + + return earnedSeedsCount; } @override diff --git a/pubspec.yaml b/pubspec.yaml index 67da327ebf3d0fdfdbceb45a491400fba1bb180c..8d28b01d331cd46ac77a12d1d6f961fe3fa0dd03 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Awale game publish_to: "none" -version: 0.0.5+5 +version: 0.0.6+6 environment: sdk: "^3.0.0"