mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Récupération du nom du PHB dans la liste des sorts
This commit is contained in:
		
							parent
							
								
									94d2629b38
								
							
						
					
					
						commit
						b16f56d3b8
					
				
					 1 changed files with 14 additions and 2 deletions
				
			
		|  | @ -41,10 +41,22 @@ namespace AideDeJeuLib.Spells | ||||||
|                 if (thssort.Length > 0) |                 if (thssort.Length > 0) | ||||||
|                 { |                 { | ||||||
|                     Spell spell = new Spell(); |                     Spell spell = new Spell(); | ||||||
|                     spell.Name = thssort[0].InnerText; |                     var aname = thssort[0].Element("a"); | ||||||
|                     var href = thssort[0].Element("a").GetAttributeValue("href", ""); |                     var spanname = aname.Element("span"); | ||||||
|  |                     if(spanname != null) | ||||||
|  |                     { | ||||||
|  |                         spell.NamePHB = spanname.GetAttributeValue("title", ""); | ||||||
|  |                         spell.Name = spanname.Element("strong").InnerText; | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|  |                     { | ||||||
|  |                         spell.NamePHB = aname.Element("strong").InnerText; | ||||||
|  |                         spell.Name = aname.Element("strong").InnerText; | ||||||
|  |                     } | ||||||
|  |                     var href = aname.GetAttributeValue("href", ""); | ||||||
|                     var regex = new Regex("vf=(?<id>.*)"); |                     var regex = new Regex("vf=(?<id>.*)"); | ||||||
|                     spell.Id = regex.Match(href).Groups["id"].Value; |                     spell.Id = regex.Match(href).Groups["id"].Value; | ||||||
|  | 
 | ||||||
|                     spell.Level = thssort[1].InnerText; |                     spell.Level = thssort[1].InnerText; | ||||||
|                     spell.Type = thssort[2].InnerText; |                     spell.Type = thssort[2].InnerText; | ||||||
|                     spell.CastingTime = thssort[3].InnerText; |                     spell.CastingTime = thssort[3].InnerText; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez