mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +00:00 
			
		
		
		
	Adaptation aux changements
This commit is contained in:
		
							parent
							
								
									c1c00d0659
								
							
						
					
					
						commit
						dbe69aba04
					
				
					 1 changed files with 6 additions and 12 deletions
				
			
		|  | @ -1,5 +1,6 @@ | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||||
|  | using AideDeJeu.ViewModels; | ||||||
| using AideDeJeuLib.Cards; | using AideDeJeuLib.Cards; | ||||||
| using AideDeJeuLib.Spells; | using AideDeJeuLib.Spells; | ||||||
| using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||||
|  | @ -13,23 +14,16 @@ namespace AideDeJeuWeb.Controllers | ||||||
|         [HttpGet("{classe}")] |         [HttpGet("{classe}")] | ||||||
|         public async Task<IEnumerable<CardData>> Get(string classe) |         public async Task<IEnumerable<CardData>> Get(string classe) | ||||||
|         { |         { | ||||||
|             var scrapper = new SpellsScrappers(); |             var items = AideDeJeu.Tools.Helpers.GetResourceObject<IEnumerable<Spell>>("AideDeJeu.Data.spells_vf.json"); | ||||||
|             var spellIds = await scrapper.GetSpellIds(classe); |             var filter = new VFSpellFilterViewModel(); | ||||||
|             var spells = await scrapper.GetSpells(spellIds); |             var fitems = await filter.FilterItems(items); | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|             var cardDatas = new List<CardData>(); |             var cardDatas = new List<CardData>(); | ||||||
|             foreach (var spell in spells) |             foreach (var spell in fitems) | ||||||
|             { |             { | ||||||
|                 cardDatas.AddRange(Converters.ToCardDatas(spell)); |                 cardDatas.AddRange(Converters.ToCardDatas(spell as Spell)); | ||||||
|             } |             } | ||||||
|             return cardDatas; |             return cardDatas; | ||||||
|             //var spellIds = spells.Select(spell => spell.Id); |  | ||||||
|             //var fullspells = await scrapper.GetSpells(spellIds); |  | ||||||
|             //return spells; |  | ||||||
|             //return await scrapper.GetSpellIds(""); |  | ||||||
|             //return await new SpellsScrappers().GetSpells(); |  | ||||||
|             //return new string[] { "value1", "value2" }; |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // GET api/values/5 |         // GET api/values/5 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez