예제 #1
0
    /// <summary>
    /// Records a bowl with the specified pinfall and triggers the next action.
    /// </summary>
    /// <param name="pinFall"></param>
    public void BowlComplete(int pinFall)
    {
        // If the game is complete, ignore the bowl
        if (gameComplete)
        {
            return;
        }

        try {
            // Update the list of bowls and frame scores
            bowls.Add(pinFall);
            frameScores = ScoreMaster.ScoreFrames(bowls);
            scoreDisplay.FillBowls(bowls);
            scoreDisplay.FillFrames(frameScores);
            popupController.SetScore(frameScores.LastOrDefault <int>());

            // Perform the next action
            ActionMaster.Action nextAction = ActionMaster.GetNextAction(bowls);
            PerformAction(nextAction);
        } catch (Exception ex) {
            if (ex is SystemException || ex is UnityException)
            {
                Debug.LogWarning("Exception occurred during BowlComplete method: " + ex.ToString() + ex.StackTrace);
            }
            else
            {
                throw;
            }
        }
    }
예제 #2
0
    public void Bowl(int pinFall)
    {
        bowls.Add(pinFall);
        ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
        pinSetter.HandleAction(nextAction);
        ball.Reset();

        try {
            scoreDisplay.FillBowls(bowls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(bowls));
        } catch {
            Debug.LogError("Could not fill roll card");
        }
    }
예제 #3
0
 public void Bowl(int pinFall)
 {
     try{
         bowls.Add(pinFall);
         ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
         pinSetter.PerformAction(nextAction);
     } catch {
         Debug.LogWarning("Something went wrong in Bowl");
     } try{
         scoreDisplay.FillBowls(bowls);
         scoreDisplay.FillFrameScores(ScoreMaster.ScoreCumulative(bowls));
     } catch {
         Debug.LogWarning("FillRollCard Failed");
     }
     ball.Reset();
     inPlayTime = 25f;
     GameOver();
 }