Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
org.benoitharrault.colors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
org.benoitharrault.colors
Commits
f208b07b
Commit
f208b07b
authored
2 years ago
by
Benoît Harrault
Browse files
Options
Downloads
Plain Diff
Merge branch '5-count-moves' into 'master'
Resolve "Count moves" Closes
#5
See merge request
!4
parents
8b033e15
e4afe613
Branches
Branches containing commit
Tags
Release_0.0.4_4
Tags containing commit
1 merge request
!4
Resolve "Count moves"
Pipeline
#2728
passed
2 years ago
Stage: update
Stage: build-debug
Changes
4
Pipelines
5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
android/gradle.properties
+2
-2
2 additions, 2 deletions
android/gradle.properties
lib/layout/game.dart
+12
-0
12 additions, 0 deletions
lib/layout/game.dart
lib/provider/data.dart
+11
-0
11 additions, 0 deletions
lib/provider/data.dart
lib/utils/board_utils.dart
+2
-0
2 additions, 0 deletions
lib/utils/board_utils.dart
with
27 additions
and
2 deletions
android/gradle.properties
+
2
−
2
View file @
f208b07b
org.gradle.jvmargs
=
-Xmx1536M
android.useAndroidX
=
true
android.enableJetifier
=
true
app.versionName
=
0.0.
3
app.versionCode
=
3
app.versionName
=
0.0.
4
app.versionCode
=
4
This diff is collapsed.
Click to expand it.
lib/layout/game.dart
+
12
−
0
View file @
f208b07b
...
...
@@ -17,6 +17,18 @@ class Game {
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
8
),
Container
(
child:
Text
(
myProvider
.
movesCount
.
toString
(),
style:
TextStyle
(
fontSize:
40
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black
,
),
),
),
SizedBox
(
height:
2
),
Expanded
(
child:
Board
.
buildGameBoard
(
myProvider
),
),
...
...
This diff is collapsed.
Click to expand it.
lib/provider/data.dart
+
11
−
0
View file @
f208b07b
...
...
@@ -21,6 +21,7 @@ class Data extends ChangeNotifier {
bool
_gameWon
=
false
;
int
_boardSize
=
0
;
int
_colorsCount
=
0
;
int
_movesCount
=
0
;
List
_cells
=
[];
String
get
level
=
>
_level
;
...
...
@@ -125,6 +126,15 @@ class Data extends ChangeNotifier {
notifyListeners
();
}
int
get
movesCount
=
>
_movesCount
;
void
updateMovesCount
(
int
movesCount
)
{
_movesCount
=
movesCount
;
notifyListeners
();
}
void
incrementMovesCount
()
{
updateMovesCount
(
movesCount
+
1
);
}
bool
get
gameIsRunning
=
>
_gameIsRunning
;
void
updateGameIsRunning
(
bool
gameIsRunning
)
{
_gameIsRunning
=
gameIsRunning
;
...
...
@@ -144,6 +154,7 @@ class Data extends ChangeNotifier {
void
resetGame
()
{
_gameIsRunning
=
false
;
_gameWon
=
false
;
_movesCount
=
0
;
notifyListeners
();
}
...
...
This diff is collapsed.
Click to expand it.
lib/utils/board_utils.dart
+
2
−
0
View file @
f208b07b
...
...
@@ -47,6 +47,8 @@ class BoardUtils {
for
(
var
cellIndex
=
0
;
cellIndex
<
cellsToFill
.
length
;
cellIndex
++
)
{
myProvider
.
updateCellValue
(
cellsToFill
[
cellIndex
][
1
],
cellsToFill
[
cellIndex
][
0
],
value
);
}
myProvider
.
incrementMovesCount
();
}
static
List
getSiblingFillableCells
(
Data
myProvider
,
row
,
col
,
siblingCells
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment