mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 15:36:07 +00:00 
			
		
		
		
	Comparers
This commit is contained in:
		
							parent
							
								
									7f2392669c
								
							
						
					
					
						commit
						e1bf110ec8
					
				
					 1 changed files with 6 additions and 12 deletions
				
			
		|  | @ -361,18 +361,12 @@ namespace AideDeJeu.ViewModels.Library | ||||||
|                 using (var context = await StoreViewModel.GetLibraryContextAsync()) |                 using (var context = await StoreViewModel.GetLibraryContextAsync()) | ||||||
|                 { |                 { | ||||||
|                     return context.Monsters.Where(monster => |                     return context.Monsters.Where(monster => | ||||||
|                         monster != null && |                         MatchEquals(monster.Family, this.Family) && | ||||||
|                         monster.Family == this.Family && |                         MatchContains(monster.Type, type) && | ||||||
|                         monster.Type.Contains(type) && |                         MatchEquals(monster.Size, size) && | ||||||
|                         (string.IsNullOrEmpty(size) || (monster.Size != null && monster.Size.Equals(size))) && |                         MatchContains(monster.Terrain, terrain) && | ||||||
|                         (string.IsNullOrEmpty(source) || (monster.Source != null && monster.Source.Contains(source))) && |                         MatchRange(monster.Challenge, minChallenge, maxChallenge, challengeComparer) && | ||||||
|                         (string.IsNullOrEmpty(terrain) || (monster.Terrain != null && monster.Terrain.Contains(terrain))) && |                         MatchSearch(monster)  | ||||||
|                         challengeComparer.Compare(monster.Challenge, minChallenge) >= 0 && |  | ||||||
|                         challengeComparer.Compare(monster.Challenge, maxChallenge) <= 0 && |  | ||||||
|                         ( |  | ||||||
|                             (Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) || |  | ||||||
|                             (Helpers.RemoveDiacritics(monster.AltNameText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) |  | ||||||
|                         ) |  | ||||||
|                     ).OrderBy(monster => Helpers.RemoveDiacritics(monster.Name)).ToList(); |                     ).OrderBy(monster => Helpers.RemoveDiacritics(monster.Name)).ToList(); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez