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); }
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); }