public static CardRepositoryDto GetActiveCardRepositoryDto(this ActiveCardRepository cardRepository) { return(new CardRepositoryDto { Cards1Level = cardRepository.Cards1Level.Select(x => x.GetCardDto()).ToList(), Cards2Level = cardRepository.Cards2Level.Select(x => x.GetCardDto()).ToList(), Cards3Level = cardRepository.Cards3Level.Select(x => x.GetCardDto()).ToList() }); }
private void InitCardHolder(GameStorage gameStorage) { var level1 = ConvertCardDtoListToCardList(gameStorage.Level1Cards); var level2 = ConvertCardDtoListToCardList(gameStorage.Level2Cards); var level3 = ConvertCardDtoListToCardList(gameStorage.Level3Cards); var shuffler = new Shuffler <Card>(); var shuffle1 = shuffler.Shuffle(level1); var shuffle2 = shuffler.Shuffle(level2); var shuffle3 = shuffler.Shuffle(level3); var inactiveCardsRepository = new InactiveCardRepository(shuffle1, shuffle2, shuffle3); var activeCardsRepository = new ActiveCardRepository(); CardHolder = new CardHolder(activeCardsRepository, inactiveCardsRepository); }
public CardHolder(CardHolderDto dto) { ActiveCards = new ActiveCardRepository(dto.ActiveCards); InactiveCards = new InactiveCardRepository(dto.InactiveCards); }
public CardHolder(ActiveCardRepository activeCards, InactiveCardRepository inactiveCards) { ActiveCards = activeCards; InactiveCards = inactiveCards; }
public CardHolder() { ActiveCards = new ActiveCardRepository(); InactiveCards = new InactiveCardRepository(); }
private void InitCardHolder(GameStorage gameStorage) { var level1 = ConvertCardDtoListToCardList(gameStorage.Level1Cards); var level2 = ConvertCardDtoListToCardList(gameStorage.Level2Cards); var level3 = ConvertCardDtoListToCardList(gameStorage.Level3Cards); var shuffler = new Shuffler<Card>(); var shuffle1 = shuffler.Shuffle(level1); var shuffle2 = shuffler.Shuffle(level2); var shuffle3 = shuffler.Shuffle(level3); var inactiveCardsRepository = new InactiveCardRepository(shuffle1, shuffle2, shuffle3); var activeCardsRepository = new ActiveCardRepository(); CardHolder = new CardHolder(activeCardsRepository, inactiveCardsRepository); }