Ejemplo n.º 1
0
 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());
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 private IEnumerable <GraczViewModel> GetAllGamers()
 {
     return(_service.GetGamer().Select(x => new GraczViewModel
     {
         Id = x.Id,
         Imie = x.Imie,
         Nazwisko = x.Nazwisko,
         PESEL = x.PESEL
     }));
 }
Ejemplo n.º 4
0
        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);
        }