rule: Support Lasker Morris but have not implemented logic
This commit is contained in:
parent
d4b1918473
commit
8a12e02fe2
23
src/rule.cpp
23
src/rule.cpp
|
@ -29,6 +29,7 @@ struct Rule rule = {
|
|||
3, // 赛点子数为3
|
||||
false, // 没有斜线
|
||||
false, // 没有禁点,摆棋阶段被提子的点可以再摆子
|
||||
false, // Lasker Morris
|
||||
false, // 先摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
false, // 不能提对手的“三连”子,除非无子可提;
|
||||
|
@ -54,6 +55,7 @@ const struct Rule RULES[N_RULES] = {
|
|||
3, // 赛点子数为3
|
||||
false, // 没有斜线
|
||||
false, // 没有禁点,摆棋阶段被提子的点可以再摆子
|
||||
false, // Lasker Morris
|
||||
false, // 先摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
false, // 不能提对手的“三连”子,除非无子可提;
|
||||
|
@ -76,6 +78,7 @@ const struct Rule RULES[N_RULES] = {
|
|||
3, // 赛点子数为3
|
||||
true, // 有斜线
|
||||
true, // 有禁点,摆棋阶段被提子的点不能再摆子
|
||||
false, // Lasker Morris
|
||||
true, // 后摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
true, // 可以提对手的“三连”子
|
||||
|
@ -93,6 +96,7 @@ const struct Rule RULES[N_RULES] = {
|
|||
3, // 赛点子数为3
|
||||
false, // 没有斜线
|
||||
false, // 没有禁点,摆棋阶段被提子的点可以再摆子
|
||||
false, // Lasker Morris
|
||||
false, // 先摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
false, // 不能提对手的“三连”子,除非无子可提;
|
||||
|
@ -115,6 +119,25 @@ const struct Rule RULES[N_RULES] = {
|
|||
3, // 赛点子数为3
|
||||
true, // 有斜线
|
||||
false, // 没有禁点,摆棋阶段被提子的点可以再摆子
|
||||
false, // Lasker Morris
|
||||
false, // 先摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
false, // 不能提对手的“三连”子,除非无子可提;
|
||||
true, // 摆棋满子(闷棋,只有12子棋才出现)算先手负
|
||||
true, // 走棋阶段不能行动(被“闷”)算负
|
||||
true, // 剩三子时可以飞棋
|
||||
100 // 100着
|
||||
},
|
||||
{
|
||||
"Lasker Morris", // 莫里斯九子棋
|
||||
// 规则说明
|
||||
"规则与成三棋基本相同,只是在走子阶段,当一方仅剩3子时,他可以飞子到任意空位。",
|
||||
10, // 双方各9子
|
||||
3, // 飞子条件为剩余3颗子
|
||||
3, // 赛点子数为3
|
||||
false, // 没有斜线
|
||||
false, // 没有禁点,摆棋阶段被提子的点可以再摆子
|
||||
true, // Lasker Morris
|
||||
false, // 先摆棋者先行棋
|
||||
false, // 多个“三连”只能提一子
|
||||
false, // 不能提对手的“三连”子,除非无子可提;
|
||||
|
|
|
@ -42,6 +42,9 @@ struct Rule
|
|||
// In the placing phase, the points of removed pieces will no longer be able to place.
|
||||
bool hasBannedLocations;
|
||||
|
||||
// The pieces can move in the placing phase.
|
||||
bool mayMoveInPlacingPhase;
|
||||
|
||||
// The player who moves second in the placing phrase moves first in the moving phrase.
|
||||
bool isDefenderMoveFirst;
|
||||
|
||||
|
@ -70,7 +73,7 @@ struct Rule
|
|||
size_t nMoveRule;
|
||||
};
|
||||
|
||||
#define N_RULES 4
|
||||
#define N_RULES 5
|
||||
extern const struct Rule RULES[N_RULES];
|
||||
extern struct Rule rule;
|
||||
extern bool set_rule(int ruleIdx) noexcept;
|
||||
|
|
|
@ -117,6 +117,11 @@ void on_hasBannedLocations(const Option &o)
|
|||
rule.hasBannedLocations = (bool)o;
|
||||
}
|
||||
|
||||
void on_mayMoveInPlacingPhase(const Option &o)
|
||||
{
|
||||
rule.mayMoveInPlacingPhase = (bool)o;
|
||||
}
|
||||
|
||||
void on_isDefenderMoveFirst(const Option &o)
|
||||
{
|
||||
rule.isDefenderMoveFirst = (bool)o;
|
||||
|
@ -196,6 +201,7 @@ void init(OptionsMap &o)
|
|||
o["PiecesAtLeastCount"] << Option(3, 3, 5, on_piecesAtLeastCount);
|
||||
o["HasDiagonalLines"] << Option(false, on_hasDiagonalLines);
|
||||
o["HasBannedLocations"] << Option(false, on_hasBannedLocations);
|
||||
o["MayMoveInPlacingPhase"] << Option(false, on_mayMoveInPlacingPhase);
|
||||
o["IsDefenderMoveFirst"] << Option(false, on_isDefenderMoveFirst);
|
||||
o["MayRemoveMultiple"] << Option(false, on_mayRemoveMultiple);
|
||||
o["MayRemoveFromMillsAlways"] << Option(false, on_mayRemoveFromMillsAlways);
|
||||
|
|
|
@ -72,6 +72,7 @@ class Config {
|
|||
static int piecesAtLeastCount = 3;
|
||||
static bool hasDiagonalLines = false;
|
||||
static bool hasBannedLocations = false;
|
||||
static bool mayMoveInPlacingPhase = false;
|
||||
static bool isDefenderMoveFirst = false;
|
||||
static bool mayRemoveMultiple = false;
|
||||
static bool mayRemoveFromMillsAlways = false;
|
||||
|
@ -107,7 +108,8 @@ class Config {
|
|||
Config.experimentsEnabled = settings['ExperimentsEnabled'] ?? false;
|
||||
|
||||
// Display
|
||||
Config.languageCode = settings['LanguageCode'] ?? Constants.defaultLanguageCodeName;
|
||||
Config.languageCode =
|
||||
settings['LanguageCode'] ?? Constants.defaultLanguageCodeName;
|
||||
Config.standardNotationEnabled =
|
||||
settings['StandardNotationEnabled'] ?? true;
|
||||
Config.isPieceCountInHandShown =
|
||||
|
@ -145,6 +147,8 @@ class Config {
|
|||
Config.hasDiagonalLines = settings['HasDiagonalLines'] ?? false;
|
||||
rule.hasBannedLocations =
|
||||
Config.hasBannedLocations = settings['HasBannedLocations'] ?? false;
|
||||
rule.mayMoveInPlacingPhase = Config.mayMoveInPlacingPhase =
|
||||
settings['MayMoveInPlacingPhase'] ?? false;
|
||||
rule.isDefenderMoveFirst =
|
||||
Config.isDefenderMoveFirst = settings['IsDefenderMoveFirst'] ?? false;
|
||||
rule.mayRemoveMultiple =
|
||||
|
@ -215,6 +219,7 @@ class Config {
|
|||
settings['PiecesAtLeastCount'] = Config.piecesAtLeastCount;
|
||||
settings['HasDiagonalLines'] = Config.hasDiagonalLines;
|
||||
settings['HasBannedLocations'] = Config.hasBannedLocations;
|
||||
settings['MayMoveInPlacingPhase'] = Config.mayMoveInPlacingPhase;
|
||||
settings['IsDefenderMoveFirst'] = Config.isDefenderMoveFirst;
|
||||
settings['MayRemoveMultiple'] = Config.mayRemoveMultiple;
|
||||
settings['MayRemoveFromMillsAlways'] = Config.mayRemoveFromMillsAlways;
|
||||
|
|
|
@ -154,6 +154,8 @@ class NativeEngine extends Engine {
|
|||
'setoption name HasDiagonalLines value ${Config.hasDiagonalLines}');
|
||||
await send(
|
||||
'setoption name HasBannedLocations value ${Config.hasBannedLocations}');
|
||||
await send(
|
||||
'setoption name MayMoveInPlacingPhase value ${Config.mayMoveInPlacingPhase}');
|
||||
await send(
|
||||
'setoption name IsDefenderMoveFirst value ${Config.isDefenderMoveFirst}');
|
||||
await send(
|
||||
|
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "اللغة الافتراضية",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "يمكن أن تتحرك القطع في مرحلة الوضع",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "لا توجد مراحل وضع وتحريك مميزة ، أي يمكن للاعبين أن يقرروا في كل حركة ما إذا كانوا يريدون وضع قطعة على اللوحة أو نقل إحدى قطعهم (طالما أن لديهم قطعًا متبقية لوضعها).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Základní jazyk",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Figurky se mohou pohybovat ve fázi umísťování",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Fáze umisťování a fáze pohybu nejsou odděleny, tj. hráči se mohou v každém tahu rozhodnout, zda chtějí umístit figurku na hrací plochu, nebo zda chtějí některou ze svých figurek přemístit (pokud jim zbývají figurky k umístění).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Standardsprache",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Die Steine können sich in der Setzphase bewegen",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Es gibt keine getrennten Setz- und Zugphasen, d.h. die Spieler können bei jedem Zug entscheiden, ob sie einen Stein auf dem Brett setzen oder einen ihrer Steine bewegen wollen (solange sie noch Steine zum Setzen haben).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Default language",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "The pieces can move in the placing phase",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Idioma por defecto",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Las piezas pueden moverse en la fase de colocación",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "No hay fases distintas de colocación y movimiento, es decir, los jugadores pueden decidir en cada movimiento si quieren colocar una pieza en el tablero o mover una de sus piezas (siempre que les queden piezas por colocar).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "زبان پیش فرض",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "مهره ها می توانند در مرحله قرارگیری حرکت کنند",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "هیچ مرحله مشخصی برای قرار دادن و حرکت وجود ندارد ، به عنوان مثال بازیکنان می توانند در هر حرکت تصمیم بگیرند که آیا می خواهند مهره ای را روی صفحه قرار دهند یا یکی از مهره های خود را حرکت دهند (به شرط اینکه مهره هایی برای قرار دادن باقی مانده باشد).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Langue par défaut",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Les pièces peuvent se déplacer dans la phase de placement",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Il n'y a pas de phases distinctes de placement et de déplacement, c'est-à-dire que les joueurs peuvent décider à chaque déplacement s'ils veulent placer une pièce sur le plateau ou déplacer une de leurs pièces (tant qu'il leur reste des pièces à placer).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "डिफ़ॉल्ट भाषा",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "टुकड़े चरण रखने में आगे बढ़ सकते हैं",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "कोई अलग प्लेसमेंट और मूविंग चरण नहीं हैं, यानी खिलाड़ी हर कदम पर यह तय कर सकते हैं कि वे बोर्ड पर एक टुकड़ा रखना चाहते हैं या अपने एक टुकड़े को स्थानांतरित करना चाहते हैं (जब तक कि उनके पास शेष टुकड़े हों)।",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Alapértelmezett nyelv",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "A darabok mozoghatnak az elhelyezési fázisban",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Nincs külön elhelyezési és mozgási fázis, azaz a játékosok minden lépésnél eldönthetik, hogy egy bábut akarnak-e elhelyezni a táblán, vagy pedig az egyik bábujukat akarják-e mozgatni (amíg van még elhelyezendő bábujuk).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Lingua predefinita",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "I pezzi possono muoversi nella fase di piazzamento",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Non ci sono fasi di piazzamento e di spostamento distinte, cioè i giocatori possono decidere ad ogni mossa se vogliono piazzare un pezzo sulla tavola o muovere uno dei loro pezzi (finché hanno pezzi rimanenti da piazzare).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "デフォルト言語",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "振り子の段階で行くことができる",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "スイング・フェーズとムーブ・フェーズの間に厳密な境界はありません。 つまり、プレイヤーは1手ごとにスイングするか移動するかを決めることができます(スイングする駒が残っている限り)。",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "기본 언어",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "진자 단계에서 걸을 수 있습니다",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "유 각기와 보행기 사이에는 엄격한 경계가 없습니다. 즉, 플레이어는 움직일 때마다 움직일 것인지 움직일 것인지 결정할 수 있습니다 (움직일 수있는 조각이 남아있는 한).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Domyślny język",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Figurki mogą się poruszać w fazie umieszczania",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Nie ma oddzielnych faz umieszczania i poruszania, tzn. gracze mogą w każdym ruchu zdecydować, czy chcą umieścić element na planszy, czy poruszyć jeden ze swoich elementów (tak długo, jak długo mają pozostałe elementy do umieszczenia).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Língua por defeito",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "As peças podem mover-se em fase de colocação",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Não há fases distintas de colocação e movimentação, ou seja, os jogadores podem decidir em cada jogada se querem colocar uma peça no tabuleiro ou mover uma das suas peças (desde que tenham peças restantes para colocar).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Limba implicita",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Piesele se pot deplasa în faza de plasare",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Nu există faze distincte de plasare și de mutare, adică jucătorii pot decide la fiecare mutare dacă doresc să plaseze o piesă pe tablă sau să mute una dintre piesele lor (atâta timp cât mai au piese de plasat).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Язык по умолчанию",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Фигуры могут перемещаться в фазе размещения",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Не существует отдельных фаз размещения и перемещения, т.е. игроки могут решать на каждом ходу, хотят ли они разместить фигуру на доске или переместить одну из своих фигур (пока у них есть оставшиеся фигуры для размещения).",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "Varsayılan dil",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "Parçalar yerleştirme aşamasında hareket edebilir",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "Belirgin bir yerleştirme ve taşıma aşamaları yoktur, yani oyuncular her hamlede tahtaya bir taş yerleştirmek mi yoksa taşlarından birini hareket ettirmek mi (yerleştirecekleri kalan taşları olduğu sürece) karar verebilirler.",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -948,5 +948,13 @@
|
|||
"defaultLanguage": "默认语言",
|
||||
"@defaultLanguage": {
|
||||
"description": "Default language"
|
||||
},
|
||||
"mayMoveInPlacingPhase": "可以在摆子阶段走子",
|
||||
"@mayMoveInPlacingPhase": {
|
||||
"description": "The pieces can move in the placing phase"
|
||||
},
|
||||
"mayMoveInPlacingPhase_Detail": "摆子阶段和走子阶段无严格界限。即,玩家可以在每一步棋中决定是要摆子还是走子(只要还有剩余的棋子可以摆子)。",
|
||||
"@mayMoveInPlacingPhase_Detail": {
|
||||
"description": "There are no distinct placing and moving phases, i.e. the players can decide at every move whether they want to place a piece on the board or move one of their pieces (as long as they have remaining pieces to place)."
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ class Rule {
|
|||
int piecesAtLeastCount = 3;
|
||||
bool hasDiagonalLines = false;
|
||||
bool hasBannedLocations = false;
|
||||
bool mayMoveInPlacingPhase = false;
|
||||
bool isDefenderMoveFirst = false;
|
||||
bool mayRemoveMultiple = false;
|
||||
bool mayRemoveFromMillsAlways = false;
|
||||
|
|
|
@ -114,6 +114,16 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
|
|||
SettingsCard(
|
||||
context: context,
|
||||
children: <Widget>[
|
||||
Config.experimentsEnabled
|
||||
? SettingsSwitchListTile(
|
||||
context: context,
|
||||
value: Config.mayMoveInPlacingPhase,
|
||||
onChanged: setMayMoveInPlacingPhase,
|
||||
titleString: S.of(context).mayMoveInPlacingPhase,
|
||||
subtitleString: S.of(context).mayMoveInPlacingPhase_Detail,
|
||||
)
|
||||
: SizedBox(height: 1),
|
||||
Config.experimentsEnabled ? ListItemDivider() : SizedBox(height: 1),
|
||||
SettingsSwitchListTile(
|
||||
context: context,
|
||||
value: Config.isDefenderMoveFirst,
|
||||
|
@ -382,6 +392,16 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
|
|||
|
||||
// Moving
|
||||
|
||||
setMayMoveInPlacingPhase(bool value) async {
|
||||
setState(() {
|
||||
rule.mayMoveInPlacingPhase = Config.mayMoveInPlacingPhase = value;
|
||||
});
|
||||
|
||||
print("[config] rule.mayMoveInPlacingPhase: $value");
|
||||
|
||||
Config.save();
|
||||
}
|
||||
|
||||
setIsDefenderMoveFirst(bool value) async {
|
||||
setState(() {
|
||||
rule.isDefenderMoveFirst = Config.isDefenderMoveFirst = value;
|
||||
|
|
Loading…
Reference in New Issue