Esempio n. 1
0
 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()
     });
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public CardHolder(CardHolderDto dto)
 {
     ActiveCards   = new ActiveCardRepository(dto.ActiveCards);
     InactiveCards = new InactiveCardRepository(dto.InactiveCards);
 }
Esempio n. 4
0
 public CardHolder(ActiveCardRepository activeCards, InactiveCardRepository inactiveCards)
 {
     ActiveCards   = activeCards;
     InactiveCards = inactiveCards;
 }
Esempio n. 5
0
 public CardHolder()
 {
     ActiveCards   = new ActiveCardRepository();
     InactiveCards = new InactiveCardRepository();
 }
Esempio n. 6
0
        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);


        }
Esempio n. 7
0
 public CardHolder(CardHolderDto dto)
 {
     ActiveCards = new ActiveCardRepository(dto.ActiveCards);
     InactiveCards = new InactiveCardRepository(dto.InactiveCards);
 }
Esempio n. 8
0
 public CardHolder(ActiveCardRepository activeCards, InactiveCardRepository inactiveCards)
 {
     ActiveCards = activeCards;
     InactiveCards = inactiveCards;
 }
Esempio n. 9
0
 public CardHolder()
 {
     ActiveCards = new ActiveCardRepository();
     InactiveCards = new InactiveCardRepository();
 }