コード例 #1
0
        public CharacterData MakeAllTheViewModels(string fileName, string username,
                                                  string password)
        {
            var characterFile     = CharacterFile.From(fileName);
            var configFile        = ConfigFile.Matching(characterFile);
            var partialCards      = CharacterFile.PartialCards(characterFile);
            var localCards        = ConfigFile.ParseCards(configFile);
            var compendiumService = CompendiumService.Authenticate(Tuple.Create(username, password));
            var cardService       = CardService.Authenticate(Tuple.Create(username, password));

            var enrichedPartialCards = partialCards
                                       .Select(card => EnrichPartialCard(
                                                   Tuple.Create(Tuple.Create(cardService, compendiumService), card)))
                                       .ToArray();

            var allCardData         = localCards.Concat(enrichedPartialCards);
            var allResolvedCardData = new List <CardData>();

            foreach (var card in allCardData)
            {
                characterFile.ResolveFormulasToValues(card, configFile);
                allResolvedCardData.Add(card);
            }

            var cardViewModels = allResolvedCardData.Select(CardViewModel.From);

            return(new CharacterData(cardViewModels));
        }
コード例 #2
0
 public static List <CardData> ParseCards(ConfigFile configFile)
 {
     return(configFile.ParseCards());
 }
コード例 #3
0
 public static List <CardData> GetTheCards(ConfigFile c)
 {
     return(c.ParseCards());
 }