public ResultPage(List <TimeSpan> results, int countOfMistakes, UserResult userResult, TestType testType) : this(testType) { var average = results.Select(r => r.TotalSeconds).Average(); var newResult = new UserResult(); if (testType == TestType.Color) { newResult.CountOfMistakesColorResult = countOfMistakes; newResult.TimeColorResult = average; } else if (testType == TestType.Sound) { newResult.CountOfMistakesSoundResult = countOfMistakes; newResult.TimeSoundResult = average; } else if (testType == TestType.RandomPoint) { newResult.CountOfMistakesRandomPointResult = countOfMistakes; newResult.TimeRandomPointResult = average; } else if (testType == TestType.ColorPoint) { newResult.CountOfMistakesColorPointResult = countOfMistakes; newResult.TimeColorPointResult = average; } else if (testType == TestType.EvenOdd) { newResult.CountOfMistakesEvenOddResult = countOfMistakes; newResult.TimeEvenOddResult = average; } AddView(newResult.GetView()); userResult.Add(newResult); Content = relativeLayout; }
public ResultPage(TimeSpan resultTime, UserResult userResult, TestType testType) : this(testType) { var newResult = new UserResult(); newResult.TimeIndividualMinuteResult = resultTime.TotalSeconds; AddView(newResult.GetView()); userResult.Add(newResult); Content = relativeLayout; }
public ResultPage(int countOfCorrect, int countOfMistakes, int countOfArrows, TimeSpan resultTime, UserResult userResult, TestType testType) : this(testType) { var time = resultTime.TotalSeconds; var newResult = new UserResult(); if (testType == TestType.Arrow) { newResult.TimeArrowResult = time; newResult.CountOfCorrectArrowResult = countOfCorrect; newResult.CountOfMistakesArrowResult = countOfMistakes; } AddView(newResult.GetView()); userResult.Add(newResult); Content = relativeLayout; }