Пример #1
0
        public async Task TestMethod1()
        {
            var store    = new StoreViewModel();
            var item     = store.ToItem(null, AideDeJeu.Tools.Helpers.GetResourceString($"AideDeJeu.Data.sandbox.md"));
            var md       = item.Markdown;
            var children = await item.GetChildrenAsync();

            foreach (var iitem in children)
            {
                md += iitem.Markdown;
            }
            Assert.IsNotNull(md);
        }
Пример #2
0
        public async Task <IEnumerable <CardData> > Get(string classe)
        {
            //var items = AideDeJeu.Tools.Helpers.GetResourceObject<IEnumerable<Spell>>("AideDeJeu.Data.spells_vf.json");
            var md = await AideDeJeu.Tools.Helpers.GetResourceStringAsync("AideDeJeu.Data.spells_hd.md");

            var store = new StoreViewModel();
            var item  = store.ToItem(null, md);
            var items = await item.GetChildrenAsync();

            var fitems = items.Where(it => (it as Spell).Source.Contains(classe)).OrderBy(it => (it as Spell).Level).ThenBy(it => it.Name);

            var cardDatas = new List <CardData>();

            foreach (var spell in fitems)
            {
                cardDatas.AddRange(Converters.ToCardDatas(spell as Spell));
            }
            return(cardDatas);
        }