コード例 #1
0
        public void PlayDay(Random random)
        {
            var gameData = gameDataRepo.GetCurrentData();

            //var gamesToPlay = scheduleGameRepository.GetGamesForDay(gameData.CurrentDay, gameData.CurrentYear).Where(g => !g.Complete).ToList();
            var gamesToPlay = scheduleGameRepo.GetInCompleteGamesForDay(gameData.CurrentDay, gameData.CurrentYear).ToList();

            gamesToPlay.ForEach(game =>
            {
                //setup the game players here
                var competition = game.Competition;
                competition.PlayGame(game, random);
                scheduleGameRepo.Update(game);
            });

            leagueRepo.Flush();
        }