flutter: Set default rule to Nine men's morris
This commit is contained in:
parent
1d6d82d313
commit
b40617e74a
|
@ -49,16 +49,16 @@ class Config {
|
|||
static int whitePieceColor = UIColors.whitePieceColor.value;
|
||||
|
||||
// Rules
|
||||
static int piecesCount = 12;
|
||||
static int piecesCount = 9;
|
||||
static int piecesAtLeastCount = 3;
|
||||
static bool hasDiagonalLines = true;
|
||||
static bool hasBannedLocations = true;
|
||||
static bool isDefenderMoveFirst = true;
|
||||
static bool hasDiagonalLines = false;
|
||||
static bool hasBannedLocations = false;
|
||||
static bool isDefenderMoveFirst = false;
|
||||
static bool mayRemoveMultiple = false;
|
||||
static bool mayRemoveFromMillsAlways = true;
|
||||
static bool mayRemoveFromMillsAlways = false;
|
||||
static bool isBlackLoseButNotDrawWhenBoardFull = true;
|
||||
static bool isLoseButNotChangeSideWhenNoWay = true;
|
||||
static bool mayFly = false;
|
||||
static bool mayFly = true;
|
||||
static int maxStepsLedToDraw = 50;
|
||||
|
||||
static Future<void> loadProfile() async {
|
||||
|
@ -97,26 +97,26 @@ class Config {
|
|||
profile['WhitePieceColor'] ?? UIColors.whitePieceColor.value;
|
||||
|
||||
// Rules
|
||||
rule.piecesCount = Config.piecesCount = profile['PiecesCount'] ?? 12;
|
||||
rule.piecesCount = Config.piecesCount = profile['PiecesCount'] ?? 9;
|
||||
rule.piecesAtLeastCount =
|
||||
Config.piecesAtLeastCount = profile['PiecesAtLeastCount'] ?? 3;
|
||||
rule.hasDiagonalLines =
|
||||
Config.hasDiagonalLines = profile['HasDiagonalLines'] ?? true;
|
||||
Config.hasDiagonalLines = profile['HasDiagonalLines'] ?? false;
|
||||
rule.hasBannedLocations =
|
||||
Config.hasBannedLocations = profile['HasBannedLocations'] ?? true;
|
||||
Config.hasBannedLocations = profile['HasBannedLocations'] ?? false;
|
||||
rule.isDefenderMoveFirst =
|
||||
Config.isDefenderMoveFirst = profile['IsDefenderMoveFirst'] ?? true;
|
||||
Config.isDefenderMoveFirst = profile['IsDefenderMoveFirst'] ?? false;
|
||||
rule.mayRemoveMultiple =
|
||||
Config.mayRemoveMultiple = profile['MayRemoveMultiple'] ?? false;
|
||||
rule.mayRemoveFromMillsAlways = Config.mayRemoveFromMillsAlways =
|
||||
profile['MayRemoveFromMillsAlways'] ?? true;
|
||||
profile['MayRemoveFromMillsAlways'] ?? false;
|
||||
rule.isBlackLoseButNotDrawWhenBoardFull =
|
||||
Config.isBlackLoseButNotDrawWhenBoardFull =
|
||||
profile['IsBlackLoseButNotDrawWhenBoardFull'] ?? true;
|
||||
rule.isLoseButNotChangeSideWhenNoWay =
|
||||
Config.isLoseButNotChangeSideWhenNoWay =
|
||||
profile['IsLoseButNotChangeSideWhenNoWay'] ?? true;
|
||||
rule.mayFly = Config.mayFly = profile['MayFly'] ?? false;
|
||||
rule.mayFly = Config.mayFly = profile['MayFly'] ?? true;
|
||||
rule.maxStepsLedToDraw =
|
||||
Config.maxStepsLedToDraw = profile['MaxStepsLedToDraw'] ?? 50;
|
||||
}
|
||||
|
|
|
@ -17,19 +17,19 @@
|
|||
*/
|
||||
|
||||
class Rule {
|
||||
String name = "Da San Qi";
|
||||
String name = "Nine Men's Morris";
|
||||
String description = "";
|
||||
int piecesCount = 12; // 9 or 12
|
||||
int piecesCount = 9; // 9 or 12
|
||||
int piecesAtLeastCount = 3; // Default is 3
|
||||
bool hasDiagonalLines = true;
|
||||
bool hasBannedLocations = true;
|
||||
bool isDefenderMoveFirst = true;
|
||||
bool hasDiagonalLines = false;
|
||||
bool hasBannedLocations = false;
|
||||
bool isDefenderMoveFirst = false;
|
||||
bool mayRemoveMultiple = false;
|
||||
bool mayRemoveFromMillsAlways = true;
|
||||
bool mayRemoveFromMillsAlways = false;
|
||||
bool isBlackLoseButNotDrawWhenBoardFull = true;
|
||||
bool isLoseButNotChangeSideWhenNoWay = true;
|
||||
bool mayFly = false;
|
||||
int maxStepsLedToDraw = 0;
|
||||
bool mayFly = true;
|
||||
int maxStepsLedToDraw = 50;
|
||||
}
|
||||
|
||||
Rule rule = Rule();
|
||||
|
|
Loading…
Reference in New Issue