Beispiel #1
0
        public TeamStats Map(Teams teams)
        {
            var teamsStats = new TeamStats()
            {
                YearId         = teams.YearId,
                LgId           = teams.LgId,
                TeamId         = teams.TeamId,
                FranchId       = teams.FranchId,
                DivId          = teams.DivId,
                DivWin         = teams.DivWin,
                Wcwin          = teams.DivWin,
                LgWin          = teams.LgWin,
                Wswin          = teams.Wswin,
                Name           = teams.Name,
                Park           = teams.Park,
                TeamIdbr       = teams.TeamIdbr,
                TeamIdlahman45 = teams.TeamIdlahman45,
                TeamIdretro    = teams.TeamIdretro,
            };

            ConvertOptionalParamsToNonNullable(teams, teamsStats);

            _calculator.CalculateStats(teamsStats);

            return(teamsStats);
        }
Beispiel #2
0
        public BattingStats Map(Batting batting)
        {
            var battingStats = new BattingStats()
            {
                PlayerId = batting.PlayerId,
                YearId   = batting.YearId,
                Stint    = batting.Stint,
                TeamId   = batting.TeamId,
                LgId     = batting.LgId,
            };

            CopyPlayerDataIfPlayerExists(batting, battingStats);
            CopyNullableStats(batting, battingStats);

            _calculator.CalculateStats(battingStats);

            return(battingStats);
        }
        public PitchingStats Map(Pitching pitching)
        {
            var pitchingStats = new PitchingStats()
            {
                PlayerId = pitching.PlayerId,
                YearId   = pitching.YearId,
                Stint    = pitching.Stint,
                TeamId   = pitching.TeamId,
                LgId     = pitching.LgId,
            };

            CopyPlayerDataIfPlayerExists(pitching, pitchingStats);

            CopyNullableStats(pitching, pitchingStats);

            _calculator.CalculateStats(pitchingStats);

            return(pitchingStats);
        }