コード例 #1
0
ファイル: RankingService.cs プロジェクト: pmpm/typ2012
        public RankingService(IRankingRepository rankingRepository)
        {
            if(rankingRepository == null)
                throw new ArgumentNullException("rankingRepostiory");

            this._rankingRepository = rankingRepository;
        }
コード例 #2
0
 public FormulaService(IDriverRepository driverRepository, ICircuitRepository circuitRepository, IRankingRepository rankingRepository, ITeamRepository teamRepository)
 {
     _driverRepository  = driverRepository;
     _circuitRepository = circuitRepository;
     _rankingRepository = rankingRepository;
     _teamRepository    = teamRepository;
 }
コード例 #3
0
 public RankingService(IRankingRepository rankingRepository,
                       IUnitOfWork unitOfWork,
                       INotificationHandler notifications)
     : base(unitOfWork, notifications)
 {
     _rankingRepository = rankingRepository;
 }
コード例 #4
0
 public GebiedController(IGebiedRepository gebiedRepository, IEvenementRepository evenementRepository
                         , IRankingRepository rankingRepository)
 {
     _gebiedRepository    = gebiedRepository;
     _evenementRepository = evenementRepository;
     _rankingRepository   = rankingRepository;
 }
コード例 #5
0
        public async Task <List <PlayerRankingModel> > CreatePlayerViewModel(IRankingRepository rankingRepository, IPlayerRepository playerRepository)
        {
            IEnumerable <Player> allPlayers = await playerRepository.ListAllAsync();

            List <PlayerRankingModel> playerRankingModelList = new List <PlayerRankingModel>();

            foreach (Player player in allPlayers)
            {
                PlayerRankingModel playerRankingModelToAdd = new PlayerRankingModel();
                try
                {
                    PlayerRanking PR = await rankingRepository.GetByPlayerIdAsync(player.PlayerId);

                    playerRankingModelToAdd.playerRanking = PR;
                }
                catch
                {
                    PlayerRanking PR = new PlayerRanking
                    {
                        PlayerId = player.PlayerId
                    };
                    playerRankingModelToAdd.playerRanking = PR;
                }
                finally
                {
                    playerRankingModelToAdd.playerToRank = player;
                    playerRankingModelList.Add(playerRankingModelToAdd);
                }
            }
            return(playerRankingModelList);
        }
コード例 #6
0
 public RankingService(IGameRepository gameRepository, IShotRepository shotRepository, IPlayerRepository playerRepository, IRankingRepository rankingRepository, IPlayerGameStatisticsRepository playerGameStatisticsRepository)
 {
     _gameRepository = gameRepository;
     _shotRepository = shotRepository;
     _playerRepository = playerRepository;
     _rankingRepository = rankingRepository;
     _playerGameStatisticsRepository = playerGameStatisticsRepository;
 }
コード例 #7
0
 public ManagingStudentService()
 {
     studentRepository      = new StudentRepository();
     rankingRepository      = new RankingRepository();
     learningModeRepository = new LearningModeRepository();
     majorRepository        = new MajorRepository();
     ethnicRepository       = new EthnicRepository();
 }
コード例 #8
0
 public RankingService(IGameRepository gameRepository, IShotRepository shotRepository, IPlayerRepository playerRepository, IRankingRepository rankingRepository, IPlayerGameStatisticsRepository playerGameStatisticsRepository)
 {
     _gameRepository    = gameRepository;
     _shotRepository    = shotRepository;
     _playerRepository  = playerRepository;
     _rankingRepository = rankingRepository;
     _playerGameStatisticsRepository = playerGameStatisticsRepository;
 }
コード例 #9
0
        public async Task <List <PlayerRankingModel> > CreatePlayerViewModel(IRankingRepository rankingRepository, IPlayerRepository playerRepository, int profileID)
        {
            int defaultProfileID            = 2025;
            IEnumerable <Player> allPlayers = await playerRepository.ListAllAsync();

            IEnumerable <PlayerRanking> allRanksofProfile = await rankingRepository.GetAllRanksByProfileId(profileID);

            List <PlayerRankingModel> playerRankingModelList = new List <PlayerRankingModel>();

            foreach (Player player in allPlayers)
            {
                PlayerRankingModel playerRankingModelToAdd = new PlayerRankingModel();
                PlayerRanking      PR = allRanksofProfile.FirstOrDefault(x => x.PlayerId == player.PlayerId);
                playerRankingModelToAdd.playerRanking = PR;
                playerRankingModelToAdd.playerToRank  = player;
                playerRankingModelToAdd.playerRanking.TestUserProfileId = profileID;
                playerRankingModelList.Add(playerRankingModelToAdd);
            }

            if (playerRankingModelList.Count > 0)
            {
                return(playerRankingModelList);
            }


            else
            {
                foreach (Player player in allPlayers)
                {
                    PlayerRankingModel playerRankingModelToAdd = new PlayerRankingModel();
                    try
                    {
                        PlayerRanking PR = await rankingRepository.GetByPlayerIdAsync(player.PlayerId);

                        if (PR.TestUserProfileId == defaultProfileID)
                        {
                            PR.TestUserProfileId = profileID;
                            playerRankingModelToAdd.playerRanking = PR;
                            await _rankingRepository.AddAsync(PR);
                        }
                    }
                    catch
                    {
                        PlayerRanking PR = new PlayerRanking
                        {
                            PlayerId = player.PlayerId
                        };
                        playerRankingModelToAdd.playerRanking = PR;
                    }
                    finally
                    {
                        playerRankingModelToAdd.playerToRank = player;
                        playerRankingModelList.Add(playerRankingModelToAdd);
                    }
                }
                return(playerRankingModelList);
            }
        }
コード例 #10
0
ファイル: RankingService.cs プロジェクト: pmpm/typ2012
        public RankingService(IRankingRepository rankingRepository)
        {
            if (rankingRepository == null)
            {
                throw new ArgumentNullException("rankingRepostiory");
            }

            this._rankingRepository = rankingRepository;
        }
コード例 #11
0
ファイル: BetStrategyService.cs プロジェクト: pmpm/typ2012
 public BetStrategyService(IGameRepository gameRepository, IBetRepository betRepository, IStrategyRepository strategyRepository, 
     IStrategyFactory strategyFactory,IRankingRepository rankingRepository, IScorer scorer)
 {
     this._gameRepository = gameRepository;
     this._betRepository = betRepository;
     this._strategyRepository = strategyRepository;
     this._strategyFactory = strategyFactory;
     this._rankingRepository = rankingRepository;
     this._scorer = scorer;
 }
コード例 #12
0
ファイル: BetStrategyService.cs プロジェクト: pmpm/typ2012
 public BetStrategyService(IGameRepository gameRepository, IBetRepository betRepository, IStrategyRepository strategyRepository,
                           IStrategyFactory strategyFactory, IRankingRepository rankingRepository, IScorer scorer)
 {
     this._gameRepository     = gameRepository;
     this._betRepository      = betRepository;
     this._strategyRepository = strategyRepository;
     this._strategyFactory    = strategyFactory;
     this._rankingRepository  = rankingRepository;
     this._scorer             = scorer;
 }
コード例 #13
0
ファイル: GameService.cs プロジェクト: pmpm/typ2012
        public GameService(IGameRepository gameRepository, IBetRepository betRepository, IRankingRepository rankingRepository, IScorer scorer)
        {
            if (gameRepository == null) throw new ArgumentNullException("gameRepository");
            if (betRepository == null) throw new ArgumentNullException("betRepository");
            if (scorer == null) throw new ArgumentNullException("scorer");

            this._gameRepository = gameRepository;
            this._betRepository = betRepository;
            this._rankingRepository = rankingRepository;
            this._scorer = scorer;
        }
コード例 #14
0
        public static async Task AddPlayerRanking(Player returnedPlayer, IRankingRepository rankingRepository, IPlayerRepository playerRepository)
        {
            if (await rankingRepository.GetByPlayerIdAsync(returnedPlayer.PlayerId) != null)
            {
                PlayerRanking playerRankingToDelete = await rankingRepository.GetByPlayerIdAsync(returnedPlayer.PlayerId);

                await rankingRepository.DeleteAsync(playerRankingToDelete);

                Console.Write("Previous Ranking Deleted");
            }

            PlayerRanking playerRankingToAdd = new PlayerRanking();

            playerRankingToAdd.PlayerId = returnedPlayer.PlayerId;
            IEnumerable <PlayerRanking> allPlayerRanks = await rankingRepository.ListAllAsync();

            IEnumerable <Player> allPlayers = await playerRepository.ListAllAsync();

            if (allPlayerRanks.Count() > 0)
            {
                var highestRankedPlayer  = allPlayerRanks.Max(x => x.PlayerRank);
                var highestPprPlayer     = allPlayerRanks.Max(x => x.PprRank);
                var highestDynastyPlayer = allPlayerRanks.Max(x => x.DynastyRank);
                playerRankingToAdd.PlayerRank  = highestRankedPlayer + 1;
                playerRankingToAdd.PprRank     = highestPprPlayer + 1;
                playerRankingToAdd.DynastyRank = highestDynastyPlayer + 1;
                CalculatePlayerRanking(returnedPlayer, allPlayerRanks, allPlayers, playerRankingToAdd);
            }
            else
            {
                playerRankingToAdd.PlayerRank     = 1;
                playerRankingToAdd.PosRank        = 1;
                playerRankingToAdd.PprRank        = 1;
                playerRankingToAdd.PprPosRank     = 1;
                playerRankingToAdd.DynastyRank    = 1;
                playerRankingToAdd.DynastyPosRank = 1;
            }

            playerRankingToAdd.TestUserProfileId = 2025;
            playerRankingToAdd.isDefault         = true;
            await rankingRepository.AddAsync(playerRankingToAdd);
        }
コード例 #15
0
ファイル: GameService.cs プロジェクト: pmpm/typ2012
        public GameService(IGameRepository gameRepository, IBetRepository betRepository, IRankingRepository rankingRepository, IScorer scorer)
        {
            if (gameRepository == null)
            {
                throw new ArgumentNullException("gameRepository");
            }
            if (betRepository == null)
            {
                throw new ArgumentNullException("betRepository");
            }
            if (scorer == null)
            {
                throw new ArgumentNullException("scorer");
            }

            this._gameRepository    = gameRepository;
            this._betRepository     = betRepository;
            this._rankingRepository = rankingRepository;
            this._scorer            = scorer;
        }
コード例 #16
0
 public RankingService(IRankingRepository rankingRepository,
                       ITeamRepository teamRepository,
                       ITournamentRepository tournamentRepository,
                       ITeamStatRepository teamStatRepository,
                       ITeamStatWorldCupRepository teamStatWorldCupRepository,
                       IH2HRepository h2hRepository,
                       IH2HWorldCupRepository h2hWorldCupRepository,
                       IMatchRepository matchRepository,
                       IGoalscorerRepository goalscorerRepository,
                       IPlayerRepository playerRepository)
 {
     this._rankingRepository          = rankingRepository;
     this._teamRepository             = teamRepository;
     this._tournamentRepository       = tournamentRepository;
     this._teamStatRepository         = teamStatRepository;
     this._teamStatWorldCupRepository = teamStatWorldCupRepository;
     this._h2hRepository         = h2hRepository;
     this._h2hWorldCupRepository = h2hWorldCupRepository;
     this._matchRepository       = matchRepository;
     this._goalscorerRepository  = goalscorerRepository;
     this._playerRepository      = playerRepository;
 }
コード例 #17
0
 public RankingController(IRankingRepository rankingRepository, IGebiedRepository gebiedRepository)
 {
     _rankingRepository = rankingRepository;
     _gebiedRepository  = gebiedRepository;
 }
コード例 #18
0
 public RankingService(IRankingRepository repository)
 {
     this.repository = repository;
 }
コード例 #19
0
 public RankingObjConcluidosController()
 {
     _rankingObjConcluidosRepository = new RankingRepository();
 }
コード例 #20
0
 public RankingGateway(IRankingRepository repository)
 {
     _repository = repository;
 }
コード例 #21
0
 public RankingService(IRankingRepository rankingRepository)
 {
     _rankingRepository = rankingRepository;
 }
コード例 #22
0
 public RankingService(IRankingRepository rankingRepository) : base(rankingRepository)
 {
     this.rankingRepository = rankingRepository;
 }
コード例 #23
0
        public async Task <List <PlayerRanking> > CreateListOfPlayerRanksByProfileId(int id, IPlayerRepository _playerRepository, IRankingRepository _rankingRepository)
        {
            IEnumerable <Player> allPlayers = new List <Player>();

            allPlayers = await _playerRepository.ListAllAsync();

            List <PlayerRanking> rankingsToReturn = new List <PlayerRanking>();

            foreach (Player player in allPlayers)
            {
                var playerRankingCreated = await GetByPlayerIdAndProfileIdAsync(player.PlayerId, 2025);

                PlayerRanking playerRankingToAdd = new PlayerRanking();
                playerRankingToAdd.DynastyPosRank    = playerRankingCreated.DynastyPosRank;
                playerRankingToAdd.DynastyRank       = playerRankingCreated.DynastyRank;
                playerRankingToAdd.isDefault         = false;
                playerRankingToAdd.Player            = playerRankingCreated.Player;
                playerRankingToAdd.PlayerId          = playerRankingCreated.PlayerId;
                playerRankingToAdd.PlayerRank        = playerRankingCreated.PlayerRank;
                playerRankingToAdd.PosRank           = playerRankingCreated.PosRank;
                playerRankingToAdd.PprPosRank        = playerRankingCreated.PprPosRank;
                playerRankingToAdd.PprRank           = playerRankingCreated.PprRank;
                playerRankingToAdd.TestUserProfileId = id;
                //rankingsToReturn.Add(playerRankingCreated);
                await _rankingRepository.AddAsync(playerRankingToAdd);
            }

            return(rankingsToReturn);
        }
コード例 #24
0
 public PlayerRankingController(IPlayerRepository playerRepository, IRankingRepository rankingRepository)
 {
     _playerRepository       = playerRepository;
     _rankingRepository      = rankingRepository;
     _createPlayerViewModels = new CreatePlayerViewModels(_rankingRepository);
 }
コード例 #25
0
 public PlayerController(IPlayerRepository playerRepository, IRankingRepository rankingRepository)
 {
     _playerRepository  = playerRepository;
     _rankingRepository = rankingRepository;
 }
コード例 #26
0
 public RankingObjOcultosController()
 {
     _rankingObjOcultosRepository = new RankingRepository();
 }
コード例 #27
0
 public RankingService()
 {
     _rankingRepository = DatabaseFactory.GetRankingRepository();
 }
コード例 #28
0
 public rankingController()
 {
     _rankingRepository = new RankingRepository();
 }
コード例 #29
0
 public ProfileUserController(IProfileRepository profileRepository, IPlayerRepository playerRepository, IRankingRepository rankingRepository)
 {
     _profileRepository = profileRepository;
     _playerRepository  = playerRepository;
     _rankingRepository = rankingRepository;
 }
コード例 #30
0
 public CreatePlayerViewModels(IRankingRepository rankingRepository)
 {
     _rankingRepository = rankingRepository;
 }
コード例 #31
0
 public RankingNotasController()
 {
     _rankingCurtidaRepository = new RankingRepository();
 }
コード例 #32
0
 public RankingController(IRankingRepository repository,
                          IVideoPostRepository vpRepository)
 {
     _repository   = repository;
     _vpRepository = vpRepository;
 }
コード例 #33
0
 public RankingService(IGameRepository gameRepository, IRankingRepository rankingRepository, IUnitOfWork unitOfWork)
 {
     _gameRepository = gameRepository;
     _rankingRepository = rankingRepository;
     _unitOfWork = unitOfWork;
 }
コード例 #34
0
 public RankingController(IRepository <Lancamentos> respository, IRankingRepository rankingRepository)
 {
     _repository        = respository;
     _rankingRepository = rankingRepository;
 }