public static SplitedTehai CalcSplitedTehai(Tehai tehai, string horaPai, bool isRon) { //手配&和了牌の牌の合計枚数をカウント int[] inHandSyu = new int[MJUtil.LENGTH_SYU_ALL]; foreach (var pai in tehai.tehai) { inHandSyu[pai.PaiNumber]++; } if (isRon) { inHandSyu[PaiConverter.STRING_TO_ID[horaPai]]++; } TehaiSpliter ts = new TehaiSpliter(); //手に残っている手配のターツ構成を全て算出 var splited = ts.SplitTehai(inHandSyu, tehai.furos, horaPai, isRon); foreach (var furopai in tehai.furos) { switch (furopai.ftype) { case MJUtil.TartsuType.MINSYUN: splited.SyuNum[furopai.minPaiSyu]++; splited.SyuNum[furopai.minPaiSyu + 1]++; splited.SyuNum[furopai.minPaiSyu + 2]++; break; case MJUtil.TartsuType.MINKO: splited.SyuNum[furopai.minPaiSyu] += 3; break; case MJUtil.TartsuType.MINKANTSU: splited.SyuNum[furopai.minPaiSyu] += 4; break; } } return(splited); }
public static SplitedTehai CalcSplitedTehai(Tehai tehai, string horaPai, bool isRon) { //手配&和了牌の牌の合計枚数をカウント int[] inHandSyu = new int[MJUtil.LENGTH_SYU_ALL]; foreach (var pai in tehai.tehai) { inHandSyu[pai.PaiNumber]++; } if (isRon) { inHandSyu[PaiConverter.STRING_TO_ID[horaPai]]++; } TehaiSpliter ts = new TehaiSpliter(); //手に残っている手配のターツ構成を全て算出 var splited = ts.SplitTehai(inHandSyu, tehai.furos, horaPai, isRon); foreach (var furopai in tehai.furos) { switch (furopai.ftype) { case MJUtil.TartsuType.MINSYUN: splited.SyuNum[furopai.minPaiSyu]++; splited.SyuNum[furopai.minPaiSyu + 1]++; splited.SyuNum[furopai.minPaiSyu + 2]++; break; case MJUtil.TartsuType.MINKO: splited.SyuNum[furopai.minPaiSyu] += 3; break; case MJUtil.TartsuType.MINKANTSU: splited.SyuNum[furopai.minPaiSyu] += 4; break; } } return splited; }