From ff5f5d9a5b125853e893dd7c91e95765e4defed8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr>
Date: Mon, 29 Jan 2024 00:02:27 +0100
Subject: [PATCH] Improve pick new color

---
 android/gradle.properties                         |  4 ++--
 fastlane/metadata/android/en-US/changelogs/11.txt |  1 +
 fastlane/metadata/android/fr-FR/changelogs/11.txt |  1 +
 lib/models/game.dart                              | 11 ++++++++---
 pubspec.yaml                                      |  2 +-
 5 files changed, 13 insertions(+), 6 deletions(-)
 create mode 100644 fastlane/metadata/android/en-US/changelogs/11.txt
 create mode 100644 fastlane/metadata/android/fr-FR/changelogs/11.txt

diff --git a/android/gradle.properties b/android/gradle.properties
index 6bf54a6..f0be9fb 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.10
-app.versionCode=10
+app.versionName=0.0.11
+app.versionCode=11
diff --git a/fastlane/metadata/android/en-US/changelogs/11.txt b/fastlane/metadata/android/en-US/changelogs/11.txt
new file mode 100644
index 0000000..3cf8297
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/11.txt
@@ -0,0 +1 @@
+Improve pick new color.
diff --git a/fastlane/metadata/android/fr-FR/changelogs/11.txt b/fastlane/metadata/android/fr-FR/changelogs/11.txt
new file mode 100644
index 0000000..f8807a6
--- /dev/null
+++ b/fastlane/metadata/android/fr-FR/changelogs/11.txt
@@ -0,0 +1 @@
+Amélioration de la sélection de couleur.
diff --git a/lib/models/game.dart b/lib/models/game.dart
index 91f636b..31f0c9f 100644
--- a/lib/models/game.dart
+++ b/lib/models/game.dart
@@ -184,23 +184,25 @@ class Game {
     // build a list of values to pick one
     final List<int> values = [];
 
-    // All eligible values
+    // All eligible values (twice)
     final int maxValue = this.settings.colorsCount;
     for (int i = 1; i <= maxValue; i++) {
       values.add(i);
+      values.add(i);
     }
 
-    // Add values of current col
+    // Add values of current col (twice)
     for (int r = 0; r <= this.settings.boardSize; r++) {
       if (this.isInBoard(CellLocation.go(r, col))) {
         final int? value = this.getCellValue(CellLocation.go(r, col));
         if (value != null) {
           values.add(value);
+          values.add(value);
         }
       }
     }
 
-    // Add values of sibling cols
+    // Add values of sibling cols (twice for top rows)
     for (int deltaCol = -1; deltaCol <= 1; deltaCol++) {
       final int c = col + deltaCol;
       for (int r = 0; r < this.settings.boardSize; r++) {
@@ -208,6 +210,9 @@ class Game {
           final int? value = this.getCellValue(CellLocation.go(r, c));
           if (value != null) {
             values.add(value);
+            if (row < this.settings.boardSize / 3) {
+              values.add(value);
+            }
           }
         }
       }
diff --git a/pubspec.yaml b/pubspec.yaml
index 3dd4fa9..f71f3a6 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: Jeweled Game
 
 publish_to: 'none'
 
-version: 0.0.10+10
+version: 0.0.11+11
 
 environment:
   sdk: '^3.0.0'
-- 
GitLab