info: Conditions should not unconditionally evaluate to `true` or
to `false`. verify: pieceToRemoveCount <= 0.
(invariant_booleans at [sanmill] lib/mill/position.dart:675)
Effectively rewriting the entire audio stack
- propperly await futures
- only play sound once on take play back
Further testing is needed but as we await the autio play we should be able to remove the stopPlay now.
fix late init problem
* Enabled strict linting.
* Fix all the linting errors and disabled the rules that needed to much
restructure.
* Restructured the files.
Known Issues:
* Tap drawer menu item will get an exception when AI is thinking
Change difficulty level to 30, thinking time to 60, select AI Vs. AI and
tap Start Game, and tap on the settings in the drawer menu get the
exception:
This widget has been unmounted, so the State no longer has a context
(and should be considered defunct).
* Sound problem
when this option is enabled, it does not take effect:
Preferences -> Sound effects -> Keep mute when taking back
The sound issue is related to some async not being
appropriately handled. This leads to the game_page setting Audios.
isTemporaryMute to false before Audios evaluated the value.
This leads to the sound being played. Some out-of-order execution.
It seems to be a thing with the code in general that Futures aren't
really awaited. This will be quite some stuff to do and check later.
* Performance
Performance testing has not yet been conducted.
- move list_item_divider into lib/shared
- move lib/engine into lib/services/engine
unify Import style
- I've unified the way files are imported. We now use absolute imports everywhere.
This is not a must but I find it more usefull.
cleanup imports
- prefer using part files where needed
cleanup the drawer code.
- fixes the drawer design
Home drawer performance improvements
As the child doesn't depend on the transformation we shouldn't repaint it => better performance
Most notably:
- require_trailing_commas
- prefer_const_constructors
- type_annotate_public_apis
- always_declare_return_types
- prefer_foreach
- use_string_buffers
- join_return_with_assignment
For now disabled rules:
- avoid_positional_boolean_parameters
- constant_identifier_names
- avoid_escaping_inner_quotes
- use_build_context_synchronously
Those lint rules are going to be disabled for now as they require massive restructure and logic change of the current codebase
Already fixed:
- avoid_print (previous commit)
this enables vscode to auto format files in the flutter project.
Also fixes a formatting error
enable formatting only for dart files
format settings.json
Fix 0e8ab57b18
1. f4 d6
2. d2 b4
3. c4 d1
4. d7 d3
5. e4 g4
White:
3 d5 X 39
5 a7 OK
c37bd7cc74 said:
From test result we can known that 3/5/7/8 is OK.
0e8ab57b18 said:
Now, For this game:
1. b4 d2
2. f4 d6
3. d1 d5
4. d7 c4
5. g4 e4
5 and 7 is bad move.
Only choose 3, White place at a4/d3 (D).
But, if apply 6e547e162b,
1. b4 d2
2. f4 d6
3. d1 d5
4. d7 c4
White's 5th will not do g4 to attack. So ignore it.
1. d6 d2
2. b4 f4
3. e4 c4
4. d1 g4
5. a1
Black
bad a4 (47)
1 X
2 X
3+ OK
Can fit Commit b65d513678
Black:
Bad move: f6
Good move: c5 / b4 / d3 / d2 / e3
1. d1 d6
2. c4 f4
3. g7 d7
4. d5 g4
5. e4
3 OK
4 X
5 D or 65
6+ X
BTW:
Commit ff37bc3310
1. d6 f4
2. b4 d2
3. b6 f6
4. b2xf6 f6
5. d7
Actually, d7 is bad move.
So we do not need to consider this case.
c37bd7cc74
Limit white 6th move thinking depth to less than 8
From test result we can known that 3/5/7/8 is OK.
But if set to 8, for this game:
1. f4 d2
2. b4 d6
3. d7 e4
4. d3 g4
5. a4 c4
White will place at a7 which will lost in 45.
If change to 3/5/7, sometimes place at d5(D), sometimes place at d1(49).
So it's better than 8. Not perfect.
We choose 7.
Now, For this game:
1. b4 d2
2. f4 d6
3. d1 d5
4. d7 c4
5. g4 e4
5 and 7 is bad move.
Only choose 3, White place at a4/d3 (D).