mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-12-16 15:19:56 +00:00
Correctif source de données
This commit is contained in:
parent
d11371ae80
commit
80df171c5e
2 changed files with 39 additions and 4 deletions
|
|
@ -92,7 +92,42 @@ namespace AideDeJeu.Tools
|
||||||
var paragraphBlock = ininblock as Markdig.Syntax.ParagraphBlock;
|
var paragraphBlock = ininblock as Markdig.Syntax.ParagraphBlock;
|
||||||
//DumpParagraphBlock(paragraphBlock);
|
//DumpParagraphBlock(paragraphBlock);
|
||||||
var str = paragraphBlock.Inline.ToContainerString();
|
var str = paragraphBlock.Inline.ToContainerString();
|
||||||
var match = regex.Match(str);
|
|
||||||
|
var properties = new List<Tuple<string, Action<Spell, string>>>()
|
||||||
|
{
|
||||||
|
new Tuple<string, Action<Spell, string>>("NameVO: ", (m, s) => m.NameVO = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("CastingTime: ", (m, s) => m.CastingTime = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("Components: ", (m, s) => m.Components = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("Duration: ", (m, s) => m.Duration = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("LevelType: ", (m, s) => m.LevelType = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("Range: ", (m, s) => m.Range = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("Source: ", (m, s) => m.Source = s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("Classes: ", (m, s) => m.Source += s),
|
||||||
|
new Tuple<string, Action<Spell, string>>("", (m,s) =>
|
||||||
|
{
|
||||||
|
//if (m.Alignment != null)
|
||||||
|
//{
|
||||||
|
//App.Current.MainPage.DisplayAlert("Erreur de parsing", s, "OK");
|
||||||
|
//}
|
||||||
|
////Debug.Assert(monster.Alignment == null, str);
|
||||||
|
//var regexx = new Regex("(?<type>.*) de taille (?<size>.*), (?<alignment>.*)");
|
||||||
|
//var matchh = regexx.Match(s);
|
||||||
|
//m.Alignment = matchh.Groups["alignment"].Value;
|
||||||
|
//m.Size = matchh.Groups["size"].Value;
|
||||||
|
//m.Type = matchh.Groups["type"].Value;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var property in properties)
|
||||||
|
{
|
||||||
|
if (str.StartsWith(property.Item1))
|
||||||
|
{
|
||||||
|
property.Item2.Invoke(spell, str.Substring(property.Item1.Length));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*var match = regex.Match(str);
|
||||||
var key = match.Groups["key"].Value;
|
var key = match.Groups["key"].Value;
|
||||||
var value = match.Groups["value"].Value;
|
var value = match.Groups["value"].Value;
|
||||||
switch (key)
|
switch (key)
|
||||||
|
|
@ -121,7 +156,7 @@ namespace AideDeJeu.Tools
|
||||||
case "Classes":
|
case "Classes":
|
||||||
spell.Source += value;
|
spell.Source += value;
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ namespace AideDeJeu.ViewModels
|
||||||
{
|
{
|
||||||
resourceName = "AideDeJeu.Data.spells_vo.md";
|
resourceName = "AideDeJeu.Data.spells_vo.md";
|
||||||
var md = await Tools.Helpers.GetResourceStringAsync(resourceName);
|
var md = await Tools.Helpers.GetResourceStringAsync(resourceName);
|
||||||
_AllItems = Tools.MarkdownExtensions.MarkdownToMonsters(md);
|
_AllItems = Tools.MarkdownExtensions.MarkdownToSpells(md);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ItemSourceType.SpellHD:
|
case ItemSourceType.SpellHD:
|
||||||
|
|
@ -80,7 +80,7 @@ namespace AideDeJeu.ViewModels
|
||||||
// Yan : c'est pas plutôt cette partie qui devrait être dans une autre Task ?
|
// Yan : c'est pas plutôt cette partie qui devrait être dans une autre Task ?
|
||||||
var filterViewModel = Main.GetFilterViewModel(ItemSourceType);
|
var filterViewModel = Main.GetFilterViewModel(ItemSourceType);
|
||||||
var items = await filterViewModel.FilterItems(await GetAllItemsAsync(), token);
|
var items = await filterViewModel.FilterItems(await GetAllItemsAsync(), token);
|
||||||
Main.Items = items;
|
Main.Items = items.ToList();
|
||||||
//await Task.Run(async () => {
|
//await Task.Run(async () => {
|
||||||
// Yan : plus besoin de boucle si on change toute la liste d'un coup ;)
|
// Yan : plus besoin de boucle si on change toute la liste d'un coup ;)
|
||||||
// Yan : indispensable de repasser sur l'ui thread pour la version uwp
|
// Yan : indispensable de repasser sur l'ui thread pour la version uwp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue