Skip to content

Commit

Permalink
MentsuAnalysis構造体の変更をマージ
Browse files Browse the repository at this point in the history
Merge branch 'ver2.3'
  • Loading branch information
MihailJP committed Nov 3, 2020
2 parents 515dd1a + 2d341b9 commit 4a14b9f
Show file tree
Hide file tree
Showing 16 changed files with 226 additions and 226 deletions.
216 changes: 108 additions & 108 deletions mjcore/yaku/catalog/context.cpp

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions mjcore/yaku/catalog/dora.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
_T("銅鑼和"), get_yaku_han("dorahoh"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->shanten[ShantenType::all] == -1) && // 何かの手で和了になっている
((analysis->GameStat->DoraFlag.Omote[analysis->TsumoHai->tile] > 0) || // ツモ牌が表ドラになっている(裏ドラは対象外)
(analysis->TsumoHai->red != DoraCol::normal))); // 赤ドラか青ドラになっている
((analysis->GameStat->DoraFlag.Omote[analysis->TsumoHai().tile] > 0) || // ツモ牌が表ドラになっている(裏ドラは対象外)
(analysis->TsumoHai().red != DoraCol::normal))); // 赤ドラか青ドラになっている
}
));
/* 北四枚抜き */
Expand All @@ -20,7 +20,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
_T("北四枚抜き"), get_yaku_han("four_northes"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->shanten[ShantenType::all] == -1) && // 何かの手で和了になっている
(analysis->PlayerStat->NorthFlag == 4)); // 北4枚
(analysis->PlayerStat()->NorthFlag == 4)); // 北4枚
}
));
/* 八仙過海 */
Expand All @@ -30,10 +30,10 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
_T("春夏秋冬"), _T("四華開嶺"), _T("本花季節牌"), _T("本花草木牌"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->shanten[ShantenType::all] == -1) && // 何かの手で和了になっている
(analysis->PlayerStat->FlowerFlag.Spring) && (analysis->PlayerStat->FlowerFlag.Summer) &&
(analysis->PlayerStat->FlowerFlag.Autumn) && (analysis->PlayerStat->FlowerFlag.Winter) &&
(analysis->PlayerStat->FlowerFlag.Plum) && (analysis->PlayerStat->FlowerFlag.Orchid) &&
(analysis->PlayerStat->FlowerFlag.Chrys) && (analysis->PlayerStat->FlowerFlag.Bamboo));
(analysis->PlayerStat()->FlowerFlag.Spring) && (analysis->PlayerStat()->FlowerFlag.Summer) &&
(analysis->PlayerStat()->FlowerFlag.Autumn) && (analysis->PlayerStat()->FlowerFlag.Winter) &&
(analysis->PlayerStat()->FlowerFlag.Plum) && (analysis->PlayerStat()->FlowerFlag.Orchid) &&
(analysis->PlayerStat()->FlowerFlag.Chrys) && (analysis->PlayerStat()->FlowerFlag.Bamboo));
}
));
/* 春夏秋冬 */
Expand All @@ -43,8 +43,8 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
_T("本花季節牌"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->shanten[ShantenType::all] == -1) && // 何かの手で和了になっている
(analysis->PlayerStat->FlowerFlag.Spring) && (analysis->PlayerStat->FlowerFlag.Summer) &&
(analysis->PlayerStat->FlowerFlag.Autumn) && (analysis->PlayerStat->FlowerFlag.Winter));
(analysis->PlayerStat()->FlowerFlag.Spring) && (analysis->PlayerStat()->FlowerFlag.Summer) &&
(analysis->PlayerStat()->FlowerFlag.Autumn) && (analysis->PlayerStat()->FlowerFlag.Winter));
}
));
/* 四華開嶺 */
Expand All @@ -54,8 +54,8 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
_T("本花草木牌"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->shanten[ShantenType::all] == -1) && // 何かの手で和了になっている
(analysis->PlayerStat->FlowerFlag.Plum) && (analysis->PlayerStat->FlowerFlag.Orchid) &&
(analysis->PlayerStat->FlowerFlag.Chrys) && (analysis->PlayerStat->FlowerFlag.Bamboo));
(analysis->PlayerStat()->FlowerFlag.Plum) && (analysis->PlayerStat()->FlowerFlag.Orchid) &&
(analysis->PlayerStat()->FlowerFlag.Chrys) && (analysis->PlayerStat()->FlowerFlag.Bamboo));
}
));
/* 本花 */
Expand All @@ -65,11 +65,11 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
[](const MentsuAnalysis* const analysis) -> bool {
if (analysis->shanten[ShantenType::all] != -1) return false; // 和了ってないなら戻る
switch (analysis->GameStat->playerwind(analysis->player)) {
case SeatAbsolute::east: return analysis->PlayerStat->FlowerFlag.Spring;
case SeatAbsolute::south: return analysis->PlayerStat->FlowerFlag.Summer;
case SeatAbsolute::west: return analysis->PlayerStat->FlowerFlag.Autumn;
case SeatAbsolute::north: return analysis->PlayerStat->FlowerFlag.Winter;
default:
case SeatAbsolute::east: return analysis->PlayerStat()->FlowerFlag.Spring;
case SeatAbsolute::south: return analysis->PlayerStat()->FlowerFlag.Summer;
case SeatAbsolute::west: return analysis->PlayerStat()->FlowerFlag.Autumn;
case SeatAbsolute::north: return analysis->PlayerStat()->FlowerFlag.Winter;
default:
RaiseTolerant(EXCEPTION_MJCORE_INVALID_DATA, _T("自風が東南西北のどれでもありません"));
return false;
}
Expand All @@ -80,11 +80,11 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
[](const MentsuAnalysis* const analysis) -> bool {
if (analysis->shanten[ShantenType::all] != -1) return false; // 和了ってないなら戻る
switch (analysis->GameStat->playerwind(analysis->player)) {
case SeatAbsolute::east: return analysis->PlayerStat->FlowerFlag.Plum;
case SeatAbsolute::south: return analysis->PlayerStat->FlowerFlag.Orchid;
case SeatAbsolute::west: return analysis->PlayerStat->FlowerFlag.Chrys;
case SeatAbsolute::north: return analysis->PlayerStat->FlowerFlag.Bamboo;
default:
case SeatAbsolute::east: return analysis->PlayerStat()->FlowerFlag.Plum;
case SeatAbsolute::south: return analysis->PlayerStat()->FlowerFlag.Orchid;
case SeatAbsolute::west: return analysis->PlayerStat()->FlowerFlag.Chrys;
case SeatAbsolute::north: return analysis->PlayerStat()->FlowerFlag.Bamboo;
default:
RaiseTolerant(EXCEPTION_MJCORE_INVALID_DATA, _T("自風が東南西北のどれでもありません"));
return false;
}
Expand All @@ -96,14 +96,14 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_dora() {
const auto countRed = [](const MentsuAnalysis* const analysis) -> unsigned {
unsigned red = 0;
for (int i = 0; i < NumOfTilesInHand; i++) {
if (analysis->PlayerStat->Hand[i].tile == TileCode::noTile) continue;
else if (static_cast<int>(analysis->PlayerStat->Hand[i].tile) >= TileNonflowerMax) continue;
else if (analysis->PlayerStat->Hand[i].red == DoraCol::akaDora) ++red;
if (analysis->PlayerStat()->Hand[i].tile == TileCode::noTile) continue;
else if (static_cast<int>(analysis->PlayerStat()->Hand[i].tile) >= TileNonflowerMax) continue;
else if (analysis->PlayerStat()->Hand[i].red == DoraCol::akaDora) ++red;
}
for (int i = 1; i < analysis->PlayerStat->MeldPointer; i++) {
const auto k = &analysis->PlayerStat->Meld[i];
for (int i = 1; i < analysis->PlayerStat()->MeldPointer; i++) {
const auto k = &analysis->PlayerStat()->Meld[i];
for (int j = 0; j < (k->mstat >= MeldStat::quadConcealed ? 4 : 3); j++) {
if (analysis->PlayerStat->Meld[i].red[j] == DoraCol::akaDora) ++red;
if (analysis->PlayerStat()->Meld[i].red[j] == DoraCol::akaDora) ++red;
}
}
return red;
Expand Down
2 changes: 1 addition & 1 deletion mjcore/yaku/catalog/irreg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_irregular()
yaku::yakuCalculator::YakuCatalog::Instantiate()->catalog.push_back(Yaku(
_T("北の大地"), yaku::yakuCalculator::Yaku::HANFUNC(
[](const MentsuAnalysis* const analysis) -> yaku::yakuCalculator::Yaku::YAKU_HAN {
switch (analysis->TsumoHai->tile) { /* 何で和了ったかで分岐 */
switch (analysis->TsumoHai().tile) { /* 何で和了ったかで分岐 */
case TileCode::northWind: /* 北で和了るとダブル役満 */
return yaku::yakuCalculator::Yaku::YAKU_HAN(2_yakuman);
case TileCode::whiteDragon: /* 白で和了るとトリプル役満 */
Expand Down
20 changes: 10 additions & 10 deletions mjcore/yaku/catalog/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
_T("金鶏独立"), get_yaku_han("kinkei_dokuritsu"),
_T("全倒鋪"), _T("全求人"),
[chkHadakaTanki](const MentsuAnalysis* const analysis) -> bool {
return chkHadakaTanki(analysis) && (analysis->TsumoHai->tile == TileCode::bambooOne);
return chkHadakaTanki(analysis) && (analysis->TsumoHai().tile == TileCode::bambooOne);
}
));
// 独釣寒江雪…白待ち
Expand All @@ -129,7 +129,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
_T("独釣寒江雪"), get_yaku_han("kankou_no_yuki"),
_T("全倒鋪"), _T("全求人"),
[chkHadakaTanki](const MentsuAnalysis* const analysis) -> bool {
return chkHadakaTanki(analysis) && (analysis->TsumoHai->tile == TileCode::whiteDragon);
return chkHadakaTanki(analysis) && (analysis->TsumoHai().tile == TileCode::whiteDragon);
}
));
#endif /* GUOBIAO */
Expand Down Expand Up @@ -778,7 +778,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
(tiles[composeNumberTile(i, 4)] >= 1) && (tiles[composeNumberTile(i, 5)] >= 1) && (tiles[composeNumberTile(i, 6)] >= 1) &&
(tiles[composeNumberTile(i, 7)] >= 1) && (tiles[composeNumberTile(i, 8)] >= 1) && (tiles[composeNumberTile(i, 9)] >= 3))
yakuFlag = true;
return yakuFlag && (!(*analysis->MenzenFlag));
return yakuFlag && (!analysis->MenzenFlag());
}
));

Expand Down Expand Up @@ -845,11 +845,11 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
const std::array<TileCode, 1> shunzi1 = {composeNumberTile(i, 3)};
const std::array<TileCode, 1> shunzi2 = {composeNumberTile(i, 4)};
if (chktiles(analysis, kezi, shunzi1, true) &&
(analysis->TsumoHai->tile == composeNumberTile(i, 3)) &&
(analysis->TsumoHai().tile == composeNumberTile(i, 3)) &&
(Tile(analysis->MianziDat[0].tile).isHonor()))
flag = true;
if (chktiles(analysis, kezi, shunzi2, true) &&
(analysis->TsumoHai->tile == composeNumberTile(i, 6)) &&
(analysis->TsumoHai().tile == composeNumberTile(i, 6)) &&
(Tile(analysis->MianziDat[0].tile).isHonor()))
flag = true;
}
Expand All @@ -862,7 +862,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
_T("愚濫怒苦露酢"), yaku::yakuCalculator::Yaku::HANFUNC(
[](const MentsuAnalysis* const analysis) {
return yaku::yakuCalculator::Yaku::YAKU_HAN(
(analysis->TsumoHai->tile == TileCode::circleFive) ?
(analysis->TsumoHai().tile == TileCode::circleFive) ?
2_yakuman :
1_yakuman);
}),
Expand All @@ -876,7 +876,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
};
return chktiles_nodup(analysis, kezi, shunzi, true) &&
(analysis->MianziDat[0].tile == TileCode::circleFive) &&
(*analysis->MenzenFlag);
(analysis->MenzenFlag());
}
));
/* 喜鵲閙梅 */
Expand Down Expand Up @@ -1202,7 +1202,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
[targetTile](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->KangziCount[targetTile] >= 1) &&
(analysis->Machi == yaku::yakuCalculator::MachiType::ryanmen) &&
(analysis->TotalKezi == 1) && (*analysis->MenzenFlag));
(analysis->TotalKezi == 1) && (analysis->MenzenFlag()));
}
));
}
Expand All @@ -1215,7 +1215,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
return ((analysis->KangziCount[TileCode::eastWind] >= 1) &&
(analysis->KangziCount[TileCode::northWind] >= 1) &&
(analysis->Machi == yaku::yakuCalculator::MachiType::ryanmen) &&
(analysis->TotalKezi == 2) && (*analysis->MenzenFlag));
(analysis->TotalKezi == 2) && (analysis->MenzenFlag()));
}
));
/* 名大役満 */
Expand All @@ -1231,7 +1231,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_misc() {
yakuFlag = true;
return ((yakuFlag) &&
(analysis->Machi == yaku::yakuCalculator::MachiType::ryanmen) &&
(analysis->TotalKezi == 2) && (*analysis->MenzenFlag));
(analysis->TotalKezi == 2) && (analysis->MenzenFlag()));
}
));

Expand Down
2 changes: 1 addition & 1 deletion mjcore/yaku/catalog/pinhu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_pinhu()
_T("平和"),
[](const MentsuAnalysis* const analysis) {
return (analysis->isPinfu &&
(analysis->TsumoHai->tile == TileCode::circleOne));
(analysis->TsumoHai().tile == TileCode::circleOne));
}
));
#endif /* GUOBIAO */
Expand Down
6 changes: 3 additions & 3 deletions mjcore/yaku/catalog/post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void yaku::yakuCalculator::CalculatorThread::checkPostponedYaku
if (((analysis->Machi == yaku::yakuCalculator::MachiType::kanchan) ||
(analysis->Machi == yaku::yakuCalculator::MachiType::penchan) ||
(analysis->Machi == yaku::yakuCalculator::MachiType::tanki)) &&
(! analysis->PlayerStat->RichiFlag.RichiFlag) &&
(! analysis->PlayerStat()->RichiFlag.RichiFlag) &&
(totalHan <= 0) && (totalSemiMangan == 0)) {
LPCTSTR name = _T("カラス");
yakuHan[name] = 1_hanF(analysis);
Expand All @@ -65,7 +65,7 @@ void yaku::yakuCalculator::CalculatorThread::checkPostponedYaku
if (((analysis->Machi == yaku::yakuCalculator::MachiType::kanchan) ||
(analysis->Machi == yaku::yakuCalculator::MachiType::penchan) ||
(analysis->Machi == yaku::yakuCalculator::MachiType::tanki)) &&
(analysis->PlayerStat->RichiFlag.RichiFlag) &&
(analysis->PlayerStat()->RichiFlag.RichiFlag) &&
(totalHan == 1) && (totalSemiMangan == 0)) {
LPCTSTR name = _T("カラス立直");
yakuHan[name] = 1_hanF(analysis);
Expand All @@ -82,7 +82,7 @@ void yaku::yakuCalculator::CalculatorThread::checkPostponedYaku
if ((totalHan >= 2) && /* 2飜以上あるか? */
(totalSemiMangan == 0) && /* 役満未満か? */
(analysis->GameStat->DoraFlag.Omote[TileCode::northWind] == 0) && /* 北はドラではないか? */
((!*analysis->MenzenFlag) || (!analysis->PlayerStat->RichiFlag.RichiFlag) ||
((!analysis->MenzenFlag()) || (!analysis->PlayerStat()->RichiFlag.RichiFlag) ||
(RuleData::chkRuleApplied("uradora")) ||
(analysis->GameStat->DoraFlag.Ura[TileCode::northWind] == 0)) && /* 北は裏ドラではないか? */
(analysis->MianziDat[0].tile == TileCode::northWind)) { /* 雀頭が北か? */
Expand Down
4 changes: 2 additions & 2 deletions mjcore/yaku/catalog/quad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_quad() {
_T("暗中模索"), get_yaku_han("anchumosaku"),
[](const MentsuAnalysis* const analysis) -> bool {
return ((analysis->AnKangziCount[TileCode::redDragon] >= 1) &&
(getTileSuit(analysis->TsumoHai->tile) == TileSuit::bamboos) &&
(*analysis->TsumoAgariFlag));
(getTileSuit(analysis->TsumoHai().tile) == TileSuit::bamboos) &&
(analysis->TsumoAgariFlag()));
}
));
/* 戦車 */
Expand Down
18 changes: 9 additions & 9 deletions mjcore/yaku/catalog/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_sequence() {
_T("鳴き二盃口"), yaku::yakuCalculator::Yaku::HANFUNC(
[](const MentsuAnalysis* const analysis) {
return yaku::yakuCalculator::Yaku::YAKU_HAN(
(*analysis->MenzenFlag) ?
(analysis->MenzenFlag()) ?
0_han :
2_han,
0_han);
Expand Down Expand Up @@ -344,7 +344,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_sequence() {
ikki_tsuukan(analysis, &yakuFlag, &yakuCol);
return (yakuFlag && // 一気通貫が成立していて
(analysis->Machi == yaku::yakuCalculator::MachiType::kanchan) && // 嵌張待ちで
(analysis->PlayerStat->Hand[TsumohaiIndex].tile == composeNumberTile(yakuCol, 5)) // 和了牌が5
(analysis->PlayerStat()->Hand[TsumohaiIndex].tile == composeNumberTile(yakuCol, 5)) // 和了牌が5
);
}
));
Expand Down Expand Up @@ -448,7 +448,7 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_sequence() {
return (yakuFlag && // 一気通貫が成立していて
(analysis->KeziCount[TileCode::northWind] >= 1) && // 北の刻子があり
(getTileSuit(analysis->MianziDat[0].tile) == yakuCol) && // 一色になっていて
(analysis->PlayerStat->Hand[TsumohaiIndex].tile == composeNumberTile(yakuCol, 5)) // 和了牌が5
(analysis->TsumoHai().tile == composeNumberTile(yakuCol, 5)) // 和了牌が5
);
}
));
Expand Down Expand Up @@ -539,9 +539,9 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_sequence() {
ikki_tsuukan(analysis, &yakuFlag, &yakuCol);
return (yakuFlag && // 一気通貫が成立していて
(analysis->Machi == yaku::yakuCalculator::MachiType::kanchan) && // 嵌張待ちで
((analysis->TsumoHai->tile == composeNumberTile(yakuCol, 2)) || // 2か
(analysis->TsumoHai->tile == composeNumberTile(yakuCol, 4)) || // 4か
(analysis->TsumoHai->tile == composeNumberTile(yakuCol, 6))) // 6で和了
((analysis->TsumoHai().tile == composeNumberTile(yakuCol, 2)) || // 2か
(analysis->TsumoHai().tile == composeNumberTile(yakuCol, 4)) || // 4か
(analysis->TsumoHai().tile == composeNumberTile(yakuCol, 6))) // 6で和了
);
}
));
Expand Down Expand Up @@ -1006,10 +1006,10 @@ void yaku::yakuCalculator::YakuCatalog::catalogInit::yakulst_sequence() {
_T("三色通貫"),
[sanshoku_tsuukan](const MentsuAnalysis* const analysis) -> bool {
return (sanshoku_tsuukan(analysis) && // 三色通貫で
(*analysis->MenzenFlag) && // 門前で
(analysis->MenzenFlag()) && // 門前で
(analysis->Machi == yaku::yakuCalculator::MachiType::tanki) && // 単騎待ちで
(analysis->TsumoHai->tile != TileCode::whiteDragon) && // 白待ちでなく
(analysis->TsumoHai->tile != TileCode::greenDragon) ); // 發待ちでない
(analysis->TsumoHai().tile != TileCode::whiteDragon) && // 白待ちでなく
(analysis->TsumoHai().tile != TileCode::greenDragon) ); // 發待ちでない
}
));
/* 三色通貫全帯幺九 */
Expand Down
Loading

0 comments on commit 4a14b9f

Please sign in to comment.