package org.mahjong4j.yaku.normals;


import org.mahjong4j.hands.Kotsu;
import org.mahjong4j.hands.MentsuComp;
import org.mahjong4j.hands.Toitsu;
import org.mahjong4j.tile.MahjongTileType;

import java.util.List;

import static org.mahjong4j.yaku.normals.MahjongYakuEnum.SHOSANGEN;

/**
 * 小三元判定クラス
 * 三元牌のいずれかを雀頭とし、残り2つを刻子もしくは槓子にすることで成立
 *
 * @author yu1ro
 */
public class ShosangenResolver implements NormalYakuResolver {
    private MahjongYakuEnum yakuEnum = SHOSANGEN;

    private Toitsu janto;
    private List<Kotsu> kotsuList;

    public ShosangenResolver(MentsuComp comp) {
        janto = comp.getJanto();
        kotsuList = comp.getKotsuKantsu();
    }

    public MahjongYakuEnum getNormalYaku() {
        return yakuEnum;
    }

    public boolean isMatch() {
        if (janto.getTile().getType() != MahjongTileType.SANGEN) {
            return false;
        }
        int count = 0;
        for (Kotsu kotsu : kotsuList) {
            if (kotsu.getTile().getType() == MahjongTileType.SANGEN) {
                count++;
            }
            if (count == 2) {
                return true;
            }
        }

        return false;
    }
}

@@ -766,24 +766,120 @@
 isMatch() %7B%0A
+        //%E4%B8%83%E5%AF%BE%E5%AD%90%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%E3%81%82%E3%82%8A%E3%81%88%E3%81%AA%E3%81%84%E3%81%AE%E3%81%A7false%0A        if (janto == null) %7B%0A            return false;%0A        %7D%0A%0A
         if (

fix shosangen when chitoitsu