예제 #1
0
    public void Bowl(int pinFall)
    {
        try
        {
            m_rolls.Add(pinFall);
            BhanuAction.Action nextAction = BhanuAction.NextAction(m_rolls);
            m_pinSetter.PerformAction(nextAction);
            m_ball.Reset();
        }
        catch
        {
            Debug.LogWarning("Sir Bhanu, Something seems to be out of order, in Bowl() Method");
        }

        try
        {
            m_scoreDisplay.FillFrames(ScoreManager.ScoreCumulative(m_rolls));
            m_scoreDisplay.FillRolls(m_rolls);
        }
        catch
        {
            Debug.LogWarning("Sir Bhanu, FillRollCard() Method failed for some reason");
            m_scoreDisplay.FillRolls(m_rolls);
        }
    }
예제 #2
0
 public void T11Dondi10thFrameTurkey()
 {
     int[] rolls = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10 };
     Assert.AreEqual(m_endGame, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #3
0
 public void T10NathanBowlIndexTest()
 {
     int[] rolls = { 0, 10, 5, 1 };
     Assert.AreEqual(m_endTurn, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #4
0
 public void T09BensBowl20Test()
 {
     int[] rolls = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 0 };
     Assert.AreEqual(m_tidy, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #5
0
 public void T07EndGameAtBowl20()
 {
     int[] rolls = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
     Assert.AreEqual(m_endGame, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #6
0
 public void T06YoutubeRollsEndInEndGame()
 {
     int[] rolls = { 8, 2, 7, 3, 3, 4, 10, 2, 8, 10, 10, 8, 0, 10, 8, 2, 9 };
     Assert.AreEqual(m_endGame, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #7
0
 public void T05CheckResetAtSpareInLastFrame()
 {
     int[] rolls = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9 };
     Assert.AreEqual(m_reset, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #8
0
 public void T03Bowl28SpareReturnsEndTurn()
 {
     int[] rolls = { 2, 8 };
     Assert.AreEqual(m_endTurn, BhanuAction.NextAction(rolls.ToList()));
 }
예제 #9
0
 public void T02Bowl8ReturnsTidy()
 {
     m_pinFalls.Add(8);
     Assert.AreEqual(m_tidy, BhanuAction.NextAction(m_pinFalls));
 }
예제 #10
0
 public void T01OneStrikeReturnsEndTurn()
 {
     m_pinFalls.Add(10);
     Assert.AreEqual(m_endTurn, BhanuAction.NextAction(m_pinFalls));
 }
예제 #11
0
 public void T13BhanuBowl7ReturnsTidy()
 {
     m_pinFalls.Add(7);
     Assert.AreEqual(m_tidy, BhanuAction.NextAction(m_pinFalls));
 }
예제 #12
0
 public void T12ZeroOneGivesEndTurn()
 {
     int[] rolls = { 0, 1 };
     Assert.AreEqual(m_endTurn, BhanuAction.NextAction(rolls.ToList()));
 }