Esempio n. 1
0
 public Dtos.Game MapToDto(Models.Game game)
 {
     Dtos.Game gameCardsDto = new Dtos.Game
     {
         PlayerCards         = MapToDto(game.PlayerCards.Cards),
         BotCards            = MapToDto(game.BotCards.Cards),
         DrawPile            = MapToDto(game.DrawPile.Cards),
         PlayerExpeditions   = MapToDto(game.PlayerExpeditions),
         BotExpeditions      = MapToDto(game.BotExpeditions),
         DiscardPiles        = MapToDto(game.DiscardPiles),
         DescriptionLastTurn = game.DescriptionLastTurn
     };
     return(gameCardsDto);
 }
Esempio n. 2
0
        public Models.Game MapToModel(Dtos.Game gameDto)
        {
            Models.Game game = new Models.Game(
                new Models.Pile(MapToModel(gameDto.PlayerCards)),
                new Models.Pile(MapToModel(gameDto.BotCards)),
                new Models.Pile(MapToModel(gameDto.DrawPile)),
                MapToModel(gameDto.PlayerExpeditions),
                MapToModel(gameDto.BotExpeditions),
                MapToModel(gameDto.DiscardPiles));

            game.DescriptionLastTurn = gameDto.DescriptionLastTurn;

            return(game);
        }