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); } }
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()); }
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); }