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); } }
public void PerformAction(BhanuAction.Action bhanuAction) { if (bhanuAction == BhanuAction.Action.TIDY) { m_animator.SetTrigger("Tidy"); } else if (bhanuAction == BhanuAction.Action.ENDTURN || bhanuAction == BhanuAction.Action.RESET) { m_animator.SetTrigger("Reset"); m_pinCounter.Reset(); } else if (bhanuAction == BhanuAction.Action.ENDGAME) { throw new UnityException("Sir Bhanu, You haven't told me how to handle EndGame yet"); } }