private Activity GetFormattedStory(PlayarStatisistics redOffensive, PlayarStatisistics redDefensive,
											 PlayarStatisistics blueOffensive, PlayarStatisistics blueDefensive,
											 int goalsRed, int goalsBlue, double winningPrice, DateTime dateTime)
        {
            if (goalsRed > goalsBlue)
            {
                if (goalsBlue == 0)
                    return new Activity(string.Format("{0} and {1} gave vinkekat to {3} and {4} scoreing {2} points.",
                                                      redOffensive.Name,
                                                      redDefensive.Name,
                                                      winningPrice,
                                                      blueOffensive.Name,
                                                      blueDefensive.Name),
                                        dateTime);
                return new Activity(string.Format("{0} and {1} won {2} points against {3} and {4} ({5} - {6})",
                                                  redOffensive.Name,
                                                  redDefensive.Name,
                                                  winningPrice,
                                                  blueOffensive.Name,
                                                  blueDefensive.Name,
                                                  goalsRed,
                                                  goalsBlue),
                                    dateTime);
            }
            return new Activity(string.Format("{0} and {1} won {2} points against {3} and {4} ({5} - {6})",
                                              blueOffensive.Name,
                                              blueDefensive.Name,
                                              winningPrice,
                                              redOffensive.Name,
                                              redDefensive.Name,
                                              goalsBlue,
                                              goalsRed),
                                dateTime
                );
        }
        public ScoreResult Calculate(PlayarStatisistics redOffensive, PlayarStatisistics redDefensive, PlayarStatisistics blueOffensive, PlayarStatisistics blueDefensive, int goalsRed, int goalsBlue, int gamesPrPlayer, DateTime dateTime)
        {
            var existingRed = redOffensive.Score + redDefensive.Score;
            var existingBlue = blueOffensive.Score + blueDefensive.Score;
            var a = Math.Abs(goalsBlue - goalsRed);
            var b = Math.Abs(existingBlue - existingRed);

            const int minimumScore = 10;

            var winningPrice = (a*b*0.1)/2;

            if (!FavoriteTeamHasWon(goalsRed, goalsBlue, existingBlue, existingRed))
            {
                winningPrice = b/2;
            }
            winningPrice = Math.Max(minimumScore, winningPrice);
            return GetScoreResult(redOffensive, redDefensive, blueOffensive, blueDefensive, goalsRed, goalsBlue, winningPrice, dateTime);
        }
        protected ScoreResult GetScoreResult(PlayarStatisistics redOffensive, PlayarStatisistics redDefensive,
											 PlayarStatisistics blueOffensive, PlayarStatisistics blueDefensive,
											 int goalsRed, int goalsBlue, double winningPrice, DateTime dateTime)
        {
            if (goalsRed > goalsBlue)
            {
                return new ScoreResult(
                    GetWinningScore(redOffensive, winningPrice),
                    GetWinningScore(redDefensive, winningPrice),
                    GetLoosingScore(blueOffensive, winningPrice),
                    GetLoosingScore(blueDefensive, winningPrice),
                    winningPrice,
                    GetFormattedStory(redOffensive, redDefensive, blueOffensive, blueDefensive, goalsRed, goalsBlue, winningPrice, dateTime)
                    );
            }
            return new ScoreResult(
                GetLoosingScore(redOffensive, winningPrice),
                GetLoosingScore(redDefensive, winningPrice),
                GetWinningScore(blueOffensive, winningPrice),
                GetWinningScore(blueDefensive, winningPrice),
                winningPrice,
                    GetFormattedStory(redOffensive, redDefensive, blueOffensive, blueDefensive, goalsRed, goalsBlue, winningPrice, dateTime)
                );
        }
 protected override Events.Score GetWinningScore(PlayarStatisistics playar, double winningPrice)
 {
     if (playar.Total.GamesPlayed >= PlayarStatisistics.InplayGames)
         return base.GetWinningScore(playar, winningPrice);
     return base.GetWinningScore(playar, 300);
 }
 public ScoreResult Calculate(PlayarStatisistics redOffensive, PlayarStatisistics redDefensive, PlayarStatisistics blueOffensive, PlayarStatisistics blueDefensive, int goalsRed, int goalsBlue, int gamesPrPlayer, DateTime dateTime)
 {
     var rating = new EloRating( redOffensive.Score + redDefensive.Score, blueOffensive.Score + blueDefensive.Score, goalsRed, goalsBlue, gamesPrPlayer);
     var winningPrice = Math.Max(rating.Point1, rating.Point2) + Math.Abs(goalsBlue - goalsRed);
     return GetScoreResult(redOffensive, redDefensive, blueOffensive, blueDefensive, goalsRed, goalsBlue, winningPrice, dateTime);
 }
 protected virtual Score GetWinningScore(PlayarStatisistics playar, double winningPrice)
 {
     return new Score() { Id = playar.Id, ScoreCount = playar.Score + winningPrice };
 }