Ejemplo n.º 1
0
 public void bowl(int pinFall)
 {
     bowls.Add(pinFall);
     ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
     pinSetter.performAction(nextAction);
     ballMove.reset();
 }
Ejemplo n.º 2
0
    public void Bowl(int pinFall)
    {
        var endGame = false;

        try
        {
            rolls.Add(pinFall);

            var actionToPerform = ActionMaster.NextAction(rolls);

            if (actionToPerform == ActionMaster.Action.EndGame)
            {
                endGame = true;
            }

            pinSetter.performAction(actionToPerform);
            ball.Reset();
        }
        catch (Exception)
        {
            Debug.LogWarning("Something went wrong in Bowl");
        }

        try
        {
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));

            if (endGame)
            {
                EndGame();
            }
        }
        catch (Exception ex)
        {
            Debug.LogWarning("Something went wrong in FillRolls: " + ex.Message);
        }
    }
Ejemplo n.º 3
0
    public void Bowl(int pinFalls)
    {
        bowls.Add(pinFalls);
        ScoreMaster.Action nextAction = ScoreMaster.NextAction(bowls);
        pinSetter.performAction(nextAction);

        try
        {
            scoreDisplay.FillRollCard(bowls);
            scoreDisplay.FillFrames(ActionMaster.ScoreCumulatiove(bowls));
        } catch
        {
            Debug.LogWarning("Error help, pls");
        }
        ball.Reset();
    }
Ejemplo n.º 4
0
    public void Bowl(int pinFall)
    {
        try
        {
            rolls.Add(pinFall);

            //OLD
            //ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
            //pinSetter.performAction(nextAction);

            //NEW
            pinSetter.performAction(ActionMaster.NextAction(rolls));
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        }
        catch { Debug.LogWarning("Something went wrong in Bowl()"); }
        ball.Restart();
        print("Poszedl bowl z upadnietymi: " + pinFall);
    }