mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +00:00 
			
		
		
		
	SubItems en yaml + md
This commit is contained in:
		
							parent
							
								
									21db82d88a
								
							
						
					
					
						commit
						5c0ba5cc2e
					
				
					 19 changed files with 83773 additions and 132 deletions
				
			
		|  | @ -5,7 +5,7 @@ using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class Equipments : Item |     public class Equipments : FilteredItems | ||||||
|     { |     { | ||||||
|         public override FilterViewModel GetNewFilterViewModel() |         public override FilterViewModel GetNewFilterViewModel() | ||||||
|         { |         { | ||||||
|  |  | ||||||
							
								
								
									
										48
									
								
								AideDeJeu/AideDeJeu/Models/FilteredItems.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								AideDeJeu/AideDeJeu/Models/FilteredItems.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,48 @@ | ||||||
|  | using System; | ||||||
|  | using System.Collections; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Runtime.Serialization; | ||||||
|  | using AideDeJeu.ViewModels; | ||||||
|  | using YamlDotNet.Serialization; | ||||||
|  | 
 | ||||||
|  | namespace AideDeJeuLib | ||||||
|  | { | ||||||
|  | 
 | ||||||
|  |     public class FilteredItems : Items | ||||||
|  |     { | ||||||
|  |         [IgnoreDataMember] | ||||||
|  |         [YamlMember] | ||||||
|  |         public List<Item> SubItems | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return _Items; | ||||||
|  |             } | ||||||
|  |             set | ||||||
|  |             { | ||||||
|  | 
 | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         public override string Markdown | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 if (_Items != null) | ||||||
|  |                 { | ||||||
|  |                     var md = string.Empty; | ||||||
|  |                     foreach (var item in _Items) | ||||||
|  |                     { | ||||||
|  |                         md += item.Markdown; | ||||||
|  |                     } | ||||||
|  |                     return md; | ||||||
|  |                 } | ||||||
|  |                 return null; | ||||||
|  |             } | ||||||
|  |             set | ||||||
|  |             { | ||||||
|  | 
 | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | @ -19,7 +19,7 @@ namespace AideDeJeuLib | ||||||
|     [DataContract] |     [DataContract] | ||||||
|     public class Item //: IList<Item> |     public class Item //: IList<Item> | ||||||
|     { |     { | ||||||
|         private List<Item> _Items; |         protected List<Item> _Items; | ||||||
| 
 | 
 | ||||||
|         public Item(List<Item> items) |         public Item(List<Item> items) | ||||||
|         { |         { | ||||||
|  | @ -64,6 +64,11 @@ namespace AideDeJeuLib | ||||||
|             return null; |             return null; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         public virtual async Task LoadFilteredItemsAsync() | ||||||
|  |         { | ||||||
|  |             _Items = (await GetChildrenAsync()).ToList(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         //public int IndexOf(Item item) |         //public int IndexOf(Item item) | ||||||
|         //{ |         //{ | ||||||
|         //    return _Items.IndexOf(item); |         //    return _Items.IndexOf(item); | ||||||
|  | @ -209,6 +214,7 @@ namespace AideDeJeuLib | ||||||
|             { "MagicItem", typeof(MagicItem) }, |             { "MagicItem", typeof(MagicItem) }, | ||||||
|             { "MagicItems", typeof(MagicItems) }, |             { "MagicItems", typeof(MagicItems) }, | ||||||
|             { "PageItem", typeof(PageItem) }, |             { "PageItem", typeof(PageItem) }, | ||||||
|  |             { "ListItems", typeof(List<Items>) }, | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         [IgnoreDataMember] |         [IgnoreDataMember] | ||||||
|  |  | ||||||
|  | @ -2,103 +2,15 @@ | ||||||
| using System.Collections; | using System.Collections; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Linq; | using System.Linq; | ||||||
|  | using System.Runtime.Serialization; | ||||||
| using AideDeJeu.ViewModels; | using AideDeJeu.ViewModels; | ||||||
|  | using YamlDotNet.Serialization; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|     public class Items : Item //, IList<Item> |     public class Items : Item | ||||||
|     { |     { | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
|         //public Items(List<Item> items) : base(items) |  | ||||||
|         //{ |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public Items(IEnumerable<Item> items) : base(items) |  | ||||||
|         //{ |  | ||||||
|         //} |  | ||||||
| 
 |  | ||||||
|         //public Items() : base() |  | ||||||
|         //{ |  | ||||||
|         //}*/ |  | ||||||
|         /*        private List<Item> _Items; |  | ||||||
| 
 |  | ||||||
|                 public Items(List<Item> items) |  | ||||||
|                 { |  | ||||||
|                     _Items = items; |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public Items(IEnumerable<Item> items) |  | ||||||
|                 { |  | ||||||
|                     _Items = items.ToList(); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public Items() |  | ||||||
|                 { |  | ||||||
|                     _Items = new List<Item>(); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public string Header { get; set; } |  | ||||||
| 
 |  | ||||||
|                 public int Count => _Items.Count(); |  | ||||||
| 
 |  | ||||||
|                 public bool IsReadOnly => false; |  | ||||||
| 
 |  | ||||||
|                 public Item this[int index] { get => _Items[index]; set => _Items[index] = value; } |  | ||||||
| 
 |  | ||||||
|                 public IEnumerator<Item> GetEnumerator() |  | ||||||
|                 { |  | ||||||
|                     return _Items?.GetEnumerator(); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 IEnumerator IEnumerable.GetEnumerator() |  | ||||||
|                 { |  | ||||||
|                     return _Items?.GetEnumerator(); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public virtual FilterViewModel GetNewFilterViewModel() |  | ||||||
|                 { |  | ||||||
|                     return null; |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public int IndexOf(Item item) |  | ||||||
|                 { |  | ||||||
|                     return _Items.IndexOf(item); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public void Insert(int index, Item item) |  | ||||||
|                 { |  | ||||||
|                     _Items.Insert(index, item); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public void RemoveAt(int index) |  | ||||||
|                 { |  | ||||||
|                     _Items.RemoveAt(index); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public void Add(Item item) |  | ||||||
|                 { |  | ||||||
|                     _Items.Add(item); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public void Clear() |  | ||||||
|                 { |  | ||||||
|                     _Items.Clear(); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public bool Contains(Item item) |  | ||||||
|                 { |  | ||||||
|                     return _Items.Contains(item); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public void CopyTo(Item[] array, int arrayIndex) |  | ||||||
|                 { |  | ||||||
|                     _Items.CopyTo(array, arrayIndex); |  | ||||||
|                 } |  | ||||||
| 
 |  | ||||||
|                 public bool Remove(Item item) |  | ||||||
|                 { |  | ||||||
|                     throw new NotImplementedException(); |  | ||||||
|                 }*/ |  | ||||||
|     //} |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class MagicItems : Item |     public class MagicItems : FilteredItems | ||||||
|     { |     { | ||||||
|         public override FilterViewModel GetNewFilterViewModel() |         public override FilterViewModel GetNewFilterViewModel() | ||||||
|         { |         { | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class Monsters : Item |     public class Monsters : FilteredItems | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,10 +1,12 @@ | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
|  | using System.Runtime.Serialization; | ||||||
| using System.Text; | using System.Text; | ||||||
|  | using YamlDotNet.Serialization; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class Spells : Item |     public class Spells : FilteredItems | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class SpellsHD : Item |     public class SpellsHD : Spells | ||||||
|     { |     { | ||||||
|         public override FilterViewModel GetNewFilterViewModel() |         public override FilterViewModel GetNewFilterViewModel() | ||||||
|         { |         { | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeuLib | namespace AideDeJeuLib | ||||||
| { | { | ||||||
|     public class SpellsVO : Item |     public class SpellsVO : Spells | ||||||
|     { |     { | ||||||
|         public override FilterViewModel GetNewFilterViewModel() |         public override FilterViewModel GetNewFilterViewModel() | ||||||
|         { |         { | ||||||
|  |  | ||||||
|  | @ -352,7 +352,11 @@ namespace AideDeJeuCmd | ||||||
| 
 | 
 | ||||||
|                 foreach (var item in await context.Items.ToListAsync()) |                 foreach (var item in await context.Items.ToListAsync()) | ||||||
|                 { |                 { | ||||||
|                     var filename = Path.Combine(outDir, WebUtility.UrlEncode(item.NewId)); |                     await item.LoadFilteredItemsAsync(); | ||||||
|  |                     if(item is Spells) | ||||||
|  |                     { | ||||||
|  |                         int iii = 1; | ||||||
|  |                     } | ||||||
|                     var yaml = item.YamlMarkdown; |                     var yaml = item.YamlMarkdown; | ||||||
|                     //var rx = new Regex(@"\(.*?\.md.*?\)"); |                     //var rx = new Regex(@"\(.*?\.md.*?\)"); | ||||||
|                     //var matchess = rx.Matches(yaml); |                     //var matchess = rx.Matches(yaml); | ||||||
|  | @ -364,6 +368,7 @@ namespace AideDeJeuCmd | ||||||
|                     { |                     { | ||||||
|                         yaml = yaml.Replace($"({matchid.Key})", $"({matchid.Value})"); |                         yaml = yaml.Replace($"({matchid.Key})", $"({matchid.Value})"); | ||||||
|                     } |                     } | ||||||
|  |                     var filename = Path.Combine(outDir, WebUtility.UrlEncode(item.NewId)); | ||||||
|                     if (filename.Contains("%")) |                     if (filename.Contains("%")) | ||||||
|                     { |                     { | ||||||
|                         Console.WriteLine(filename); |                         Console.WriteLine(filename); | ||||||
|  |  | ||||||
|  | @ -1,17 +1,31 @@ | ||||||
| --- | --- | ||||||
| !LinkItem | !Items | ||||||
| Link: abilities_constitution_hd.md | Id: abilities_constitution_hd.md#constitution | ||||||
| NameLink: <!--NameLink-->[Constitution](hd_abilities_constitution.md)<!--/NameLink--> | RootId: abilities_constitution_hd.md | ||||||
| Id: abilities_hd.md#constitution | ParentLink: abilities_hd.md | ||||||
| ParentLink: abilities_hd.md#utiliser-les-caractéristiques |  | ||||||
| Name: Constitution | Name: Constitution | ||||||
| ParentName: Utiliser les caractéristiques | ParentName: Caractéristiques | ||||||
|  | NameLevel: 1 | ||||||
|  | AltName: Constitution (SRD p81) | ||||||
|  | Source: (MDR p264) | ||||||
|  | --- | ||||||
|  | >  [Caractéristiques](hd_abilities.md) | ||||||
|  | 
 | ||||||
| --- | --- | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # Constitution | ||||||
| 
 | 
 | ||||||
|  | - AltName: Constitution (SRD p81) | ||||||
|  | - Source: (MDR p264) | ||||||
| 
 | 
 | ||||||
| # [Constitution](hd_abilities_constitution.md) | La Constitution représente la santé, l'endurance et la force vitale. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | ## [Tests de Constitution](hd_abilities_constitution_tests_de_constitution.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ## [Points de vie](hd_abilities_constitution_points_de_vie.md) | ||||||
|  | 
 | ||||||
|  |  | ||||||
|  | @ -1,17 +1,55 @@ | ||||||
| --- | --- | ||||||
| !LinkItem | !Items | ||||||
| Link: abilities_intelligence_hd.md | Id: abilities_intelligence_hd.md#intelligence | ||||||
| NameLink: <!--NameLink-->[Intelligence](hd_abilities_intelligence.md)<!--/NameLink--> | RootId: abilities_intelligence_hd.md | ||||||
| Id: abilities_hd.md#intelligence | ParentLink: abilities_hd.md | ||||||
| ParentLink: abilities_hd.md#utiliser-les-caractéristiques |  | ||||||
| Name: Intelligence | Name: Intelligence | ||||||
| ParentName: Utiliser les caractéristiques | ParentName: Caractéristiques | ||||||
|  | NameLevel: 1 | ||||||
|  | AltName: Intelligence (SRD p81) | ||||||
|  | Source: (MDR p264) | ||||||
|  | --- | ||||||
|  | >  [Caractéristiques](hd_abilities.md) | ||||||
|  | 
 | ||||||
| --- | --- | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | # Intelligence | ||||||
| 
 | 
 | ||||||
|  | - AltName: Intelligence (SRD p81) | ||||||
|  | - Source: (MDR p264) | ||||||
| 
 | 
 | ||||||
| # [Intelligence](hd_abilities_intelligence.md) | L'intelligence représente la vivacité d'esprit, la mémoire et la capacité de raisonnement. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | ## [Tests d'Intelligence](hd_abilities_intelligence_tests_dintelligence.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Arcanes](hd_abilities_intelligence_arcanes.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Histoire](hd_abilities_intelligence_histoire.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Investigation](hd_abilities_intelligence_investigation.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Nature](hd_abilities_intelligence_nature.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Religion](hd_abilities_intelligence_religion.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ### [Autres tests d'Intelligence](hd_abilities_intelligence_autres_tests_dintelligence.md) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | ## [Caractéristique d'incantation](hd_abilities_intelligence_caracteristique_dincantation.md) | ||||||
|  | 
 | ||||||
|  |  | ||||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										21989
									
								
								Data/HD/hd_monsters.md
									
										
									
									
									
								
							
							
						
						
									
										21989
									
								
								Data/HD/hd_monsters.md
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										16516
									
								
								Data/HD/hd_spells.md
									
										
									
									
									
								
							
							
						
						
									
										16516
									
								
								Data/HD/hd_spells.md
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										20422
									
								
								Data/HD/srd_monsters.md
									
										
									
									
									
								
							
							
						
						
									
										20422
									
								
								Data/HD/srd_monsters.md
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										12793
									
								
								Data/HD/srd_spells.md
									
										
									
									
									
								
							
							
						
						
									
										12793
									
								
								Data/HD/srd_spells.md
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Data/library.db
									
										
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Data/library.db
									
										
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Maniez Yan
						Maniez Yan