public TeamResult(TeamResult result)
 {
     TeamId           = result.TeamId;
     TeamName         = result.TeamName;
     OverallRecord    = new Record(result.OverallRecord);
     ConferenceRecord = new Record(result.ConferenceRecord);
     DivisionRecord   = new Record(result.DivisionRecord);
 }
        public void Add(Game game)
        {
            mGames.Add(game);

            List <int> teamIds = new List <int> {
                game.HomeTeamId, game.AwayTeamId
            };
            List <string> teamNames = new List <string> {
                game.home_team, game.away_team
            };

            for (int i = 0; i < teamIds.Count; i++)
            {
                int teamId = teamIds[i];

                if (teamId > 0 && !Results.ContainsKey(teamId))
                {
                    Results[teamId] = new TeamResult(teamId, teamNames[i]);
                }
            }

            if (game.WinnerId > 0)
            {
                bool conferenceGame = game.ConferenceGame;
                bool divisionGame   = game.DivisionGame;

                TeamResult winnerResult = game.WinnerId > 0 ? Results[game.WinnerId] : null;
                if (winnerResult != null)
                {
                    winnerResult.AddWin(conferenceGame, divisionGame);
                }

                TeamResult loserResult = game.LoserId > 0 ? Results[game.LoserId] : null;
                if (loserResult != null)
                {
                    loserResult.AddLoss(conferenceGame, divisionGame);
                }
            }
        }