mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Même modif sur liste des monstres pour récupérer les noms du PHB
This commit is contained in:
		
							parent
							
								
									c94fa7be55
								
							
						
					
					
						commit
						43b181a1b5
					
				
					 2 changed files with 17 additions and 3 deletions
				
			
		|  | @ -39,7 +39,8 @@ namespace AideDeJeu.ViewModels | ||||||
| 
 | 
 | ||||||
|         public List<KeyValuePair<string, string>> Powers { get; set; } = new List<KeyValuePair<string, string>>() |         public List<KeyValuePair<string, string>> Powers { get; set; } = new List<KeyValuePair<string, string>>() | ||||||
|         { |         { | ||||||
|             new KeyValuePair<string, string>("0", "0" ), |             new KeyValuePair<string, string>("Z", "0" ), | ||||||
|  |             new KeyValuePair<string, string>(".12", "1/8" ), | ||||||
|             new KeyValuePair<string, string>(".25", "1/4" ), |             new KeyValuePair<string, string>(".25", "1/4" ), | ||||||
|             new KeyValuePair<string, string>(".5", "1/2" ), |             new KeyValuePair<string, string>(".5", "1/2" ), | ||||||
|             new KeyValuePair<string, string>("1", "1" ), |             new KeyValuePair<string, string>("1", "1" ), | ||||||
|  |  | ||||||
|  | @ -41,8 +41,21 @@ namespace AideDeJeuLib.Monsters | ||||||
|                 if (tds.Length > 0) |                 if (tds.Length > 0) | ||||||
|                 { |                 { | ||||||
|                     var monster = new Monster(); |                     var monster = new Monster(); | ||||||
|                     monster.Name = tds[0].InnerText; |                     var aname = tds[0].Element("a"); | ||||||
|                     var href = tds[0].Element("a").GetAttributeValue("href", ""); |                     var spanname = aname.Element("span"); | ||||||
|  |                     if (spanname != null) | ||||||
|  |                     { | ||||||
|  |                         monster.NamePHB = spanname.GetAttributeValue("title", ""); | ||||||
|  |                         monster.Name = spanname.Element("strong").InnerText; | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         monster.NamePHB = aname.Element("strong").InnerText; | ||||||
|  |                         monster.Name = aname.Element("strong").InnerText; | ||||||
|  |                     } | ||||||
|  | 
 | ||||||
|  |                     //monster.Name = tds[0].InnerText; | ||||||
|  |                     var href = aname.GetAttributeValue("href", ""); | ||||||
|                     var regex = new Regex("vf=(?<id>.*)"); |                     var regex = new Regex("vf=(?<id>.*)"); | ||||||
|                     monster.Id = regex.Match(href).Groups["id"].Value; |                     monster.Id = regex.Match(href).Groups["id"].Value; | ||||||
|                     monster.Power = tds[1].InnerText; |                     monster.Power = tds[1].InnerText; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez