Exemplo n.º 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);
            }
        }
Exemplo n.º 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());
        }
Exemplo n.º 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);
 }