mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
ContainsOrNot
This commit is contained in:
parent
5370a285df
commit
90ed29e5eb
4 changed files with 23 additions and 14 deletions
|
|
@ -34,6 +34,15 @@ namespace AideDeJeu.ViewModels.Library
|
|||
Helpers.RemoveDiacritics(item.AltNameText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower());
|
||||
}
|
||||
|
||||
public bool MatchContainsOrNot(string itemValue, string filterValue)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(filterValue) && string.IsNullOrWhiteSpace(filterValue))
|
||||
{
|
||||
return string.IsNullOrEmpty(itemValue);
|
||||
}
|
||||
return string.IsNullOrEmpty(filterValue) || (itemValue != null && itemValue.ToLower().Contains(filterValue.ToLower()));
|
||||
}
|
||||
|
||||
public bool MatchContains(string itemValue, string filterValue)
|
||||
{
|
||||
return string.IsNullOrEmpty(filterValue) || (itemValue != null && itemValue.ToLower().Contains(filterValue.ToLower()));
|
||||
|
|
@ -265,9 +274,9 @@ namespace AideDeJeu.ViewModels.Library
|
|||
var ritual = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Ritual).SelectedKey ?? "";
|
||||
var castingTime = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.CastingTime).SelectedKey ?? "";
|
||||
var range = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Range).SelectedKey ?? "";
|
||||
var verbalComponents = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.VerbalComponent).SelectedKey ?? "";
|
||||
var somaticComponents = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.SomaticComponent).SelectedKey ?? "";
|
||||
var materialComponents = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.MaterialComponent).SelectedKey ?? "";
|
||||
var verbalComponent = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.VerbalComponent).SelectedKey ?? "";
|
||||
var somaticComponent = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.SomaticComponent).SelectedKey ?? "";
|
||||
var materialComponent = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.MaterialComponent).SelectedKey ?? "";
|
||||
var concentration = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Concentration).SelectedKey ?? "";
|
||||
var duration = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Duration).SelectedKey ?? "";
|
||||
var source = Filters.SingleOrDefault(filter => filter.Key == FilterKeys.Source).SelectedKey ?? "";
|
||||
|
|
@ -283,13 +292,13 @@ namespace AideDeJeu.ViewModels.Library
|
|||
spell.Type.ToLower().Contains(school.ToLower()) &&
|
||||
(spell.Source != null && spell.Source.Contains(source)) &&
|
||||
(spell.Classes != null && spell.Classes.Contains(classe)) &&
|
||||
(string.IsNullOrEmpty(ritual) || (spell.Ritual != null && spell.Ritual.Contains(ritual))) &&
|
||||
MatchContainsOrNot(spell.Ritual, ritual) &&
|
||||
(spell.CastingTime != null) && spell.CastingTime.Contains(castingTime) &&
|
||||
(spell.Range != null) && spell.Range.Contains(range) &&
|
||||
(string.IsNullOrEmpty(verbalComponents) || (spell.VerbalComponent != null && spell.VerbalComponent.Contains(verbalComponents))) &&
|
||||
(string.IsNullOrEmpty(somaticComponents) || (spell.SomaticComponent != null && spell.SomaticComponent.Contains(somaticComponents))) &&
|
||||
(string.IsNullOrEmpty(materialComponents) || (spell.MaterialComponent != null && spell.MaterialComponent.Contains(materialComponents))) &&
|
||||
(string.IsNullOrEmpty(concentration) || (spell.Concentration != null && spell.Concentration.Contains(concentration))) &&
|
||||
MatchContainsOrNot(spell.VerbalComponent, verbalComponent) &&
|
||||
MatchContainsOrNot(spell.SomaticComponent, somaticComponent) &&
|
||||
MatchContainsOrNot(spell.MaterialComponent, materialComponent) &&
|
||||
MatchContainsOrNot(spell.Concentration, concentration) &&
|
||||
(spell.Duration != null) && spell.Duration.Contains(duration) &&
|
||||
(
|
||||
(Helpers.RemoveDiacritics(spell.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
Classes: Barde|Clerc|Druide|Ensorceleur|Magicien|Ombrelame|Paladin|Rôdeur|Sorcier
|
||||
Levels: Sorts mineurs|Niveau 1|Niveau 2|Niveau 3|Niveau 4|Niveau 5|Niveau 6|Niveau 7|Niveau 8|Niveau 9
|
||||
Schools: Abjuration|Divination|Enchantement|Évocation|Illusion|Invocation|Nécromancie|Transmutation
|
||||
Rituals: Rituel
|
||||
Rituals: 'Rituel| '
|
||||
CastingTimes: 1 action|1 action bonus|1 réaction|1 minute|10 minutes|1 heure|8 heures|12 heures|24 heures
|
||||
Ranges: personnel|contact|vision|selon l'arme utilisée|spéciale|1,5 mètre|3 mètres|4,50 mètres|9 mètres|12 mètres|18 mètres|27 mètres|30 mètres|36 mètres|45 mètres|90 mètres|150 mètres|450 mètres|1 kilomètre|1,5 kilomètre|7,5 kilomètres|750 kilomètres|illimitée
|
||||
VerbalComponents: V
|
||||
SomaticComponents: S
|
||||
MaterialComponents: M
|
||||
Concentrations: concentration
|
||||
VerbalComponents: 'V| '
|
||||
SomaticComponents: 'S| '
|
||||
MaterialComponents: 'M| '
|
||||
Concentrations: 'concentration| '
|
||||
Durations: instantané|1 round|1 minute|10 minutes|1 heure|2 heures|8 heures|24 heures|1 jour|7 jours|10 jours|30 jours|dissipation|déclenchement|spéciale
|
||||
Sources: SRD|MDR
|
||||
Family: SpellHD
|
||||
|
|
|
|||
BIN
Data/library.db
BIN
Data/library.db
Binary file not shown.
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
<!--SpellItems Family="SpellHD" Classes="Barde|Clerc|Druide|Ensorceleur|Magicien|Ombrelame|Paladin|Rôdeur|Sorcier" Levels="Sorts mineurs|Niveau 1|Niveau 2|Niveau 3|Niveau 4|Niveau 5|Niveau 6|Niveau 7|Niveau 8|Niveau 9" Schools="Abjuration|Divination|Enchantement|Évocation|Illusion|Invocation|Nécromancie|Transmutation" Rituals="Rituel" CastingTimes="1 action|1 action bonus|1 réaction|1 minute|10 minutes|1 heure|8 heures|12 heures|24 heures" Concentrations="concentration" Durations="instantané|1 round|1 minute|10 minutes|1 heure|2 heures|8 heures|24 heures|1 jour|7 jours|10 jours|30 jours|dissipation|déclenchement|spéciale" Ranges="personnel|contact|vision|selon l'arme utilisée|spéciale|1,5 mètre|3 mètres|4,50 mètres|9 mètres|12 mètres|18 mètres|27 mètres|30 mètres|36 mètres|45 mètres|90 mètres|150 mètres|450 mètres|1 kilomètre|1,5 kilomètre|7,5 kilomètres|750 kilomètres|illimitée" VerbalComponents="V" SomaticComponents="S" MaterialComponents="M" Sources="SRD|MDR"-->
|
||||
<!--SpellItems Family="SpellHD" Classes="Barde|Clerc|Druide|Ensorceleur|Magicien|Ombrelame|Paladin|Rôdeur|Sorcier" Levels="Sorts mineurs|Niveau 1|Niveau 2|Niveau 3|Niveau 4|Niveau 5|Niveau 6|Niveau 7|Niveau 8|Niveau 9" Schools="Abjuration|Divination|Enchantement|Évocation|Illusion|Invocation|Nécromancie|Transmutation" Rituals="Rituel| " CastingTimes="1 action|1 action bonus|1 réaction|1 minute|10 minutes|1 heure|8 heures|12 heures|24 heures" Concentrations="concentration| " Durations="instantané|1 round|1 minute|10 minutes|1 heure|2 heures|8 heures|24 heures|1 jour|7 jours|10 jours|30 jours|dissipation|déclenchement|spéciale" Ranges="personnel|contact|vision|selon l'arme utilisée|spéciale|1,5 mètre|3 mètres|4,50 mètres|9 mètres|12 mètres|18 mètres|27 mètres|30 mètres|36 mètres|45 mètres|90 mètres|150 mètres|450 mètres|1 kilomètre|1,5 kilomètre|7,5 kilomètres|750 kilomètres|illimitée" VerbalComponents="V| " SomaticComponents="S| " MaterialComponents="M| " Sources="SRD|MDR"-->
|
||||
|
||||
> <!--ParentNameLink-->[Manuel des règles](index.md)<!--/ParentNameLink-->
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue