示例#1
0
 public PinfuResolver(MentsuComp comp, GeneralSituation generalSituation, PersonalSituation personalSituation) : base(generalSituation, personalSituation)
 {
     janto        = comp.getJanto();
     shuntsuCount = comp.getShuntsuCount();
     shuntsuList  = comp.getShuntsuList();
     last         = comp.getLast();
 }
示例#2
0
        public bool isMatch()
        {
            //雀頭がnullなら七対子なのでfalse
            if (comp.getJanto() == null)
            {
                return(false);
            }
            //雀頭が一九字牌以外ならfalse
            int jantoNum = comp.getJanto().getTile().getNumber();

            if (jantoNum != 1 && jantoNum != 9 && jantoNum != 0)
            {
                return(false);
            }

            //順子が無ければfalse
            if (comp.getShuntsuCount() == 0)
            {
                return(false);
            }

            //順子が123の順子と789の順子でなければfalse
            foreach (Shuntsu shuntsu in comp.getShuntsuList())
            {
                int shuntsuNum = shuntsu.getTile().getNumber();
                if (shuntsuNum != 2 && shuntsuNum != 8)
                {
                    return(false);
                }
            }

            //刻子・槓子が一九字牌以外ならfalse
            foreach (Kotsu kotsu in comp.getKotsuKantsu())
            {
                int kotsuNum = kotsu.getTile().getNumber();
                if (kotsuNum != 1 && kotsuNum != 9 && kotsuNum != 0)
                {
                    return(false);
                }
            }

            //ここまでくればtrue
            return(true);
        }
示例#3
0
 public SanshokudohjunResolver(MentsuComp comp)
 {
     shuntsuCount = comp.getShuntsuCount();
     shuntsuList  = comp.getShuntsuList();
 }
 public IkkitsukanResolver(MentsuComp comp)
 {
     shuntsuList  = comp.getShuntsuList();
     shuntsuCount = comp.getShuntsuCount();
 }