Пример #1
0
    public static string FormatRolls(List <int> rolls)
    {
        ActionMaster actionMaster = new ActionMaster();

        actionMaster.SetBowls(rolls.ToArray());
        string toReturn    = string.Empty;
        int    rollsLength = rolls.Count;
        int    frameCount  = 0;

        for (int i = 0; i < rollsLength; i++)
        {
            if ((i == 0) || (i != 20 && i % 2 == 0))
            {
                frameCount = ((i + 1) + 1) / 2;                       // note that i+1 gives us the strart bowl throw of this frame
                string frameAnnotation = actionMaster.GetFrameAnnotation(frameCount);
                toReturn += frameAnnotation;
            }
        }
        return(toReturn);
    }