Esempio n. 1
0
        private static ScoreView MapToViews(List <IFrameScore> frameScores, Scores scores, Summaries summaries, PostResponse responseMessage)
        {
            if (frameScores == null ||
                summaries == null)
            {
                return(null);
            }
            ScoreView scoreView = new ScoreView(frameScores, scores, summaries, responseMessage);

            return(scoreView);
        }
Esempio n. 2
0
 public ScoreView(List <IFrameScore> frameScores, Scores scores, Summaries summaries, PostResponse responseMessage)
 {
     Bowler = $"{JsonConvert.SerializeObject(scores.Token)}" +
              $"{Environment.NewLine}{JsonConvert.SerializeObject(scores.Points)}";
     if (frameScores.Count > 0)
     {
         FrameView_01 = new FrameView(frameScores, summaries, 0);
     }
     if (frameScores.Count > 1)
     {
         FrameView_02 = new FrameView(frameScores, summaries, 1);
     }
     if (frameScores.Count > 2)
     {
         FrameView_03 = new FrameView(frameScores, summaries, 2);
     }
     if (frameScores.Count > 3)
     {
         FrameView_04 = new FrameView(frameScores, summaries, 3);
     }
     if (frameScores.Count > 4)
     {
         FrameView_05 = new FrameView(frameScores, summaries, 4);
     }
     if (frameScores.Count > 5)
     {
         FrameView_06 = new FrameView(frameScores, summaries, 5);
     }
     if (frameScores.Count > 6)
     {
         FrameView_07 = new FrameView(frameScores, summaries, 6);
     }
     if (frameScores.Count > 7)
     {
         FrameView_08 = new FrameView(frameScores, summaries, 7);
     }
     if (frameScores.Count > 8)
     {
         FrameView_09 = new FrameView(frameScores, summaries, 8);
     }
     if (frameScores.Count > 9)
     {
         FrameView_10 = new FrameView(frameScores, summaries, 9);
     }
     Total   = summaries.Points.Last();
     Comment = $"{JsonConvert.SerializeObject(summaries.Points)}{Environment.NewLine}" +
               $"{responseMessage}";
 }