private void MainForm_HintEvent(object sender, HintEventArgs e) { if (!e.hint.isUsed) { gamerService.UseHint(e.hint, e.question); mainForm.SetGamer(gamerService.GetGamer()); mainForm.SetAvailableHints(gamerService.GetAvailableHints()); } }
private GameResult GetGameResultObj(GameResultViewModel gameResultViewModel, Gamer gamer) { var result = Mapper.Map <GameResult>(gameResultViewModel); result.Gamer = _gamerService.GetGamer(Guid.Parse(gameResultViewModel.GamerId)); result.BoardGame = _boardGameService.Get(gameResultViewModel.BoardGameId); Mapper.Map(gamer, result); return(result); }
private IEnumerable <GraczViewModel> GetAllGamers() { return(_service.GetGamer().Select(x => new GraczViewModel { Id = x.Id, Imie = x.Imie, Nazwisko = x.Nazwisko, PESEL = x.PESEL })); }
private List <TableBoardGameDto> GetTableBoardGameObjs(IEnumerable <GameTable> gameTableList) { var tableBoardGameObjs = new List <TableBoardGameDto>(); foreach (var gameTable in gameTableList) { if (gameTable.BoardGames != null) { foreach (var boardGame in gameTable.BoardGames) { var gameTableObj = Mapper.Map <TableBoardGameDto>(boardGame); Mapper.Map(gameTable, gameTableObj); gameTableObj.GamerNickname = _gamerService.GetGamer(Guid.Parse(gameTableObj.GamerId))?.Nickname; tableBoardGameObjs.Add(gameTableObj); } } } return(tableBoardGameObjs); }