Пример #1
0
        public void Unit_YamaTsumoTest()
        {
            Yama testYama = new Yama();

            Assert.AreEqual(testYama.GetRestYamaNum(), FIRST_YAMA_LENGTH);
            foreach (var omote in testYama.GetDoraMarkerStrings())
            {
                Debug.WriteLine("Dora = " + omote);
            }

            while (testYama.GetRestYamaNum() > 0)
            {
                var tsumoObj = testYama.DoTsumo();
                Debug.WriteLine(tsumoObj.PaiString);
            }
        }
Пример #2
0
        public void Unit_YamaRinshanTest()
        {
            Yama testYama = new Yama();

            Assert.AreEqual(testYama.GetRestYamaNum(), FIRST_YAMA_LENGTH);

            var rinshanObj = testYama.DoRinshan();
            Debug.WriteLine(rinshanObj.PaiString);
            Assert.AreEqual(testYama.GetRestYamaNum(), FIRST_YAMA_LENGTH - 1);
            Assert.IsTrue(testYama.CanKan());

            rinshanObj = testYama.DoRinshan();
            Debug.WriteLine(rinshanObj.PaiString);
            Assert.IsTrue(testYama.CanKan());

            rinshanObj = testYama.DoRinshan();
            Debug.WriteLine(rinshanObj.PaiString);
            Assert.IsTrue(testYama.CanKan());

            rinshanObj = testYama.DoRinshan();
            Debug.WriteLine(rinshanObj.PaiString);
            Assert.IsFalse(testYama.CanKan());
        }
Пример #3
0
 bool CanReach(Tehai tehai, InfoForResult infoForResult, Yama yama)
 {
     return ( tehai.IsTenpai() || tehai.IsHora() )
     && tehai.IsMenzen()
     && (infoForResult.IsReach == false && infoForResult.IsDoubleReach == false)
     && (yama.GetRestYamaNum() >= Constants.PLAYER_NUM);
 }