public GameScrapperJob() { HostingEnvironment.RegisterObject(this); _clubsRepo = new ClubsRepo(); _gamesRepo = new GamesRepo(); _teamsRepo = new TeamsRepo(); }
public PgGames() { InitializeComponent(); type_combobox.ItemsSource = ListType(); pegi_combobox.ItemsSource = ListPEGI(); exclusive_combobox.ItemsSource = ListExclusive(); SetData(); gamesListView.ItemsSource = GamesRepo.GetAll(); }
public IActionResult Index([FromBody] int levelNumber = 1) { var stringCells = gameDataLoader.Load(levelNumber); var cells = parsingService.Parse(stringCells); Game game = new Game(cells, stringCells[0].Length, stringCells.Length, levelNumber); GamesRepo.AddGame(game); return(new ObjectResult(game.GameField)); }
private void BtnSearchGame_Click(object sender, RoutedEventArgs e) { string name = nameSearch.Text; string publisher = publisherSearch.Text; string producer = producerSearch.Text; string type = type_combobox.Text; string exc = exclusive_combobox.Text; string pegi = pegi_combobox.Text; gamesListView.ItemsSource = GamesRepo.Getby(name, publisher, producer, type, exc, pegi); }
public ActionResult TeamSchedules(int id, int leagueId, int seasonId) { var gamesRepo = new GamesRepo(); var resList = gamesRepo.GetCyclesByTeam(id).Where(g => g.LeagueId == leagueId); var tRepo = new TeamsRepo(); var team = tRepo.GetById(id); ViewBag.TeamId = id; ViewBag.LeagueId = leagueId; ViewBag.SeasonId = seasonId; if (team != null) { ViewBag.Logo = UIHelper.GetTeamLogo(team.Logo); ViewBag.ResTitle = team.Title.Trim(); if (team.LeagueTeams.Count > 1) { var leagues = team.LeagueTeams.Where(l => (l.Leagues.Stages.Any(s => s.GamesCycles.Any(gc => gc.HomeTeamId == id && gc.IsPublished)) || l.Leagues.Stages.Any(s => s.GamesCycles.Any(gc => gc.GuestTeamId == id && gc.IsPublished))) && l.SeasonId == seasonId); List <SelectListItem> items = new List <SelectListItem>(); foreach (var league in leagues) { items.Add(new SelectListItem { Text = league.Leagues.Name, Value = league.LeagueId.ToString(), Selected = league.LeagueId == leagueId }); } ViewBag.Leagues = items; } } var lRepo = new LeagueRepo(); var leag = lRepo.GetById(leagueId); if (leag != null) { var alias = leag.Union?.Section?.Alias; switch (alias) { case GamesAlias.WaterPolo: case GamesAlias.BasketBall: return(View("WaterPoloBasketBall/Schedules", new SchedulesDto { GameCycles = resList })); default: return(View(nameof(Schedules), new SchedulesDto { GameCycles = resList })); } } return(View(nameof(Schedules), new SchedulesDto { GameCycles = resList })); }
public void GetGame_AfterAddGame_ReturnsExpectedGame() { var expectedGame = A.Dummy <Game>(); var guid = new Guid(); expectedGame.GameField.Id = guid; GamesRepo.AddGame(expectedGame); var game = GamesRepo.GetGame(guid); game.Should().Be(expectedGame); }
public void ExportReferees(int id) { var repo = new GamesRepo(); var grid = new GridView { DataSource = repo.GetRefereesExcel(id) }; grid.DataBind(); var rer = grid.RowHeaderColumn; Response.ClearContent(); Response.AddHeader("content-disposition", "attachment; filename=ExportReferees.xls"); Response.ContentType = "application/ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); grid.RenderControl(hw); Response.Write(sw.ToString()); Response.End(); }
public IActionResult Moves(Guid gameId, [FromBody] UserInputForMovesPost userInput) { var game = GamesRepo.GetGame(gameId); game.MovePlayer(moveProvider.GetMovement(userInput)); if (game.GameField.IsFinished) { GameDto gameField = game.GameField; try { var stringCells = gameDataLoader.Load(game.GameField.Level + 1); var cells = parsingService.Parse(stringCells); game.GameField = new GameDto(cells, true, true, game.GameField.Width, game.GameField.Height, gameId, false, 0, game.GameField.Level + 1); } catch { game.GameField = gameField; } } return(new ObjectResult(game.GameField)); }
public IActionResult Leaderboard() { return(new ObjectResult(GamesRepo.GetTable())); }
public MovesController(GamesRepo gamesRepo, IMapper mapper, IFieldFactory factory) { this.mapper = mapper; this.gamesRepo = gamesRepo; this.factory = factory; }
private void Button_Click(object sender, RoutedEventArgs e) { string name; #region try/catch try { name = Name_textbox.Text; } catch { MessageBox.Show(Properties.Resources.errorAddGameChar + " 'Name'", Properties.Resources.errorError); goto End; } string publisher; try { publisher = publisher_textbox.Text; } catch { MessageBox.Show(Properties.Resources.errorAddGameChar + " 'Publisher'", Properties.Resources.errorError); goto End; } string producer; try { producer = producent_textbox.Text; } catch { MessageBox.Show(Properties.Resources.errorAddGameChar + " 'Producer'", Properties.Resources.errorError); goto End; } double price; try { price = double.Parse(price_textbox.Text); } catch { MessageBox.Show(Properties.Resources.errorAddGameDouble + " 'Price'", Properties.Resources.errorError); goto End; } uint metacritics; try { metacritics = uint.Parse(meta_textbox.Text); } catch { MessageBox.Show(Properties.Resources.errorAddGameInt + " 'Metacritics'", Properties.Resources.errorError); goto End; } uint pegi; try { pegi = uint.Parse(pegi_combobox.Text); } catch { MessageBox.Show(Properties.Resources.errorAddGameInt + " 'PEGI'", Properties.Resources.errorError); goto End; } #endregion try { string date = Date(); string exclusive = ex_combobox.Text; string isSeries = isSeries_combobox.Text; string type = type_combobox.SelectedItem.ToString(); var newGame = new Games(name, publisher, producer, type, price, date, metacritics, exclusive, isSeries, pegi); GamesRepo.Insert(newGame); } catch { MessageBox.Show(Properties.Resources.errorAddGameNewGame, Properties.Resources.errorError); } End :; }
public GamesController(IFieldFactory fieldFactory, GamesRepo gamesRepo) { this.fieldFactory = fieldFactory; this.gamesRepo = gamesRepo; }
public Account() { InitializeComponent(); gamesUserListView.ItemsSource = GamesRepo.GetByLogin(Assets.Scripts.Login.UserLogin); SetData(); }
public RatingsController() { _RatingsRepo = new RatingsRepo(); _GamesRepo = new GamesRepo(); }
public GamesController() { _GamesRepo = new GamesRepo(); }