Sfoglia il codice sorgente

Gett all info from the correct XML and list it through the app

Florian Morel 1 anno fa
parent
commit
63076d46fe

File diff suppressed because it is too large
+ 1875 - 3928
Dotnet/DataLayer/XML/01 - ldb.xml


File diff suppressed because it is too large
+ 879 - 0
Dotnet/DataLayer/XML/02 - rites de bataille.xml


+ 1 - 1
Dotnet/Deathwatch/Deathwatch.csproj.user

@@ -4,7 +4,7 @@
     <ActiveDebugProfile>IIS Express</ActiveDebugProfile>
     <RazorPage_SelectedScaffolderID>RazorPageScaffolder</RazorPage_SelectedScaffolderID>
     <RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
-    <NameOfLastUsedPublishProfile>Deathwatch - Web Deploy</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>C:\Users\FlorianMorel\Source\Repos\Warhammer\Dotnet\Deathwatch\Properties\PublishProfiles\Deathwatch20241202153149 - Web Deploy.pubxml</NameOfLastUsedPublishProfile>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <DebuggerFlavor>ProjectDebugger</DebuggerFlavor>

+ 65 - 0
Dotnet/Deathwatch/Pages/Powers.razor

@@ -0,0 +1,65 @@
+@page "/pouvoir-list"
+@using DataLayer.Interfaces
+@using Domain.XML_Model
+@attribute [StreamRendering(true)]
+
+<div>
+    <h3>Pouvoir</h3>
+</div>
+<div>
+    @if (Pouvoirs == null)
+    {
+        <p><em>Loading...</em></p>
+    }
+    else
+    {
+        <table class="table table-striped">
+            <thead>
+                <tr>
+                    <th>Nom</th>
+                    <th>Discipline</th>
+                    <th>Seuil</th>
+                    <th>Action</th>
+                    <th>Opposé</th>
+                    <th>Portée</th>
+                    <th>Prolongeable</th>
+                    <th>Description</th>
+                </tr>
+            </thead>
+            <tbody>
+                @foreach (var pouvoir in Pouvoirs)
+                {
+                    <tr>
+                        <td>@pouvoir.Nom</td>
+                        <td>@pouvoir.Discipline</td>
+                        <td>@pouvoir.Seuil</td>
+                        <td>@pouvoir.Action</td>
+                        <td>@pouvoir.Opposé</td>
+                        <td>@pouvoir.Portée</td>
+                        <td>@pouvoir.Prolongeable</td>
+                        <td>@pouvoir.Description</td>
+                    </tr>
+                }
+            </tbody>
+        </table>
+    }
+</div>
+
+@code {
+    private List<Pouvoir> Pouvoirs { get; set; }
+    [Inject]
+    public IAbstractRepository<Pouvoir> _pouvoirRepository { get; set; }
+
+    protected override async Task OnInitializedAsync()
+    {
+        // Load the pouvoirs data here
+        Pouvoirs = await LoadPouvoirsAsync();
+    }
+
+    private async Task<List<Pouvoir>> LoadPouvoirsAsync()
+    {
+        // Implement the logic to load pouvoirs data
+        var powers = await _pouvoirRepository.GetAll();
+        return powers.OrderBy(p => p.Nom).ToList();
+    }
+}

+ 59 - 0
Dotnet/Deathwatch/Pages/Skills.razor

@@ -0,0 +1,59 @@
+@page "/competence-list"
+@using DataLayer.Interfaces
+@using Domain.XML_Model
+@attribute [StreamRendering(true)]
+
+<div>
+    <h3>Competence</h3>
+</div>
+<div>
+    @if (Competences == null)
+    {
+        <p><em>Loading...</em></p>
+    }
+    else
+    {
+        <table class="table table-striped">
+            <thead>
+                <tr>
+                    <th>Nom</th>
+                    <th>Type</th>
+                    <th>Carac</th>
+                    <th>Registre</th>
+                    <th>Description</th>
+                </tr>
+            </thead>
+            <tbody>
+                @foreach (var competence in Competences)
+                {
+                    <tr>
+                        <td>@competence.Nom</td>
+                        <td>@competence.Type</td>
+                        <td>@competence.Carac</td>
+                        <td>@competence.Registre</td>
+                        <td>@competence.Description</td>
+                    </tr>
+                }
+            </tbody>
+        </table>
+    }
+</div>
+
+@code {
+    private List<Competence> Competences { get; set; }
+    [Inject]
+    public IAbstractRepository<Competence> _competenceRepository { get; set; }
+
+    protected override async Task OnInitializedAsync()
+    {
+        // Load the competences data here
+        Competences = await LoadCompetencesAsync();
+    }
+
+    private async Task<List<Competence>> LoadCompetencesAsync()
+    {
+        // Implement the logic to load competences data
+        var skills = await _competenceRepository.GetAll();
+        return skills.OrderBy(t => t.Nom).ToList();
+    }
+}

+ 58 - 0
Dotnet/Deathwatch/Pages/TraitList.razor

@@ -0,0 +1,58 @@
+@page "/trait-list"
+@using DataLayer.Interfaces
+@using Domain.XML_Model
+@attribute [StreamRendering(true)]
+
+
+<div>
+    <h3>Trait</h3>
+</div>
+<div>
+    @if (Traits == null)
+    {
+        <p><em>Loading...</em></p>
+    }
+    else
+    {
+        <table class="table table-striped">
+            <thead>
+            <tr>
+                <th>Nom</th>
+                <th>Effet</th>
+                <th>Multiple</th>
+                <th>Description</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach (var trait in Traits)
+            {
+                <tr>
+                    <td>@trait.Nom</td>
+                    <td>@trait.Effet</td>
+                    <td>@trait.Multiple</td>
+                    <td>@trait.Description</td>
+                </tr>
+            }
+            </tbody>
+        </table>
+    }
+</div>
+
+@code {
+    [Inject]
+    public IAbstractRepository<Trait> _traitRepository { get; set; }
+    private List<Trait> Traits { get; set; }
+
+    protected override async Task OnInitializedAsync()
+    {
+        // Load the traits data here
+        Traits = await LoadTraitsAsync();
+    }
+
+    private async Task<List<Trait>> LoadTraitsAsync()
+    {
+        // Implement the logic to load traits data
+        var traits = await _traitRepository.GetAll();
+        return traits.OrderBy(t => t.Nom).ToList();
+    }
+}

+ 0 - 1
Dotnet/Deathwatch/Pages/Weapon.razor

@@ -2,7 +2,6 @@
 
 
 <div class="row border border-2">
-    <div class="col  border border-2">@Arme.Id</div>
     <div class="col  border border-2">@Arme.Nom</div>
     <div class="col  border border-2">@Arme.Genre</div>
     <div class="col  border border-2">@Arme.Type</div>

+ 2 - 2
Dotnet/Deathwatch/Pages/Weapon.razor.cs

@@ -1,7 +1,7 @@
 using Domain.XML_Model;
 using Microsoft.AspNetCore.Components;
 
-namespace Deathwatch.Pages
+namespace Deathwatch.Pages.Weapon
 {
     public partial class Weapon
     {
@@ -9,7 +9,7 @@ namespace Deathwatch.Pages
         public Arme Arme { get; set; }
         public bool ShowDetails { get; set; }
 
-        private void OnStateChanged() => this.InvokeAsync(StateHasChanged);
+        private void OnStateChanged() => InvokeAsync(StateHasChanged);
 
         public Weapon()
         {

+ 0 - 1
Dotnet/Deathwatch/Pages/WeaponList.razor

@@ -14,7 +14,6 @@
     {
         <div class="container-fluid">
             <div class="row  border border-2">
-                <div class="col">Id</div>
                 <div class="col">Nom</div>
                 <div class="col">Genre</div>
                 <div class="col">Type</div>

+ 3 - 3
Dotnet/Deathwatch/Pages/WeaponList.razor.cs

@@ -3,7 +3,7 @@ using Domain.Weapons;
 using Domain.XML_Model;
 using Microsoft.AspNetCore.Components;
 
-namespace Deathwatch.Pages
+namespace Deathwatch.Pages.Weapon
 {
     public partial class WeaponList
     {
@@ -15,10 +15,10 @@ namespace Deathwatch.Pages
 
         protected override async Task OnInitializedAsync()
         {
-            var armes = (await WeaponRepository?.GetAll()).OrderBy(a => a.ArmeId).ToList();
+            var armes = (await WeaponRepository?.GetAll()).OrderBy(a => a.Nom).ToList();
             armes.ForEach(a => Weapons.Add(new Weapon(a)));
             SelectedWeapon = Weapons.FirstOrDefault();
         }
-     
+
     }
 }

+ 6 - 6
Dotnet/Deathwatch/Program.cs

@@ -35,12 +35,12 @@ using (var scope = scopeFactory.CreateScope())
 }
 
 // Configure the HTTP request pipeline.
-if (!app.Environment.IsDevelopment())
-{
-    app.UseExceptionHandler("/Error");
-    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
-    app.UseHsts();
-}
+//if (!app.Environment.IsDevelopment())
+//{
+app.UseExceptionHandler("/Error");
+// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+app.UseHsts();
+//}
 
 app.UseHttpsRedirection();
 

+ 113 - 0
Dotnet/Deathwatch/Properties/ServiceDependencies/Deathwatch20241202153149 - Web Deploy/profile.arm.json

@@ -0,0 +1,113 @@
+{
+  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+  "contentVersion": "1.0.0.0",
+  "metadata": {
+    "_dependencyType": "compute.appService.windows"
+  },
+  "parameters": {
+    "resourceGroupName": {
+      "type": "string",
+      "defaultValue": "DefaultResourceGroup-WEU",
+      "metadata": {
+        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+      }
+    },
+    "resourceGroupLocation": {
+      "type": "string",
+      "defaultValue": "westeurope",
+      "metadata": {
+        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+      }
+    },
+    "resourceName": {
+      "type": "string",
+      "defaultValue": "Deathwatch20241202153149",
+      "metadata": {
+        "description": "Name of the main resource to be created by this template."
+      }
+    },
+    "resourceLocation": {
+      "type": "string",
+      "defaultValue": "[parameters('resourceGroupLocation')]",
+      "metadata": {
+        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+      }
+    }
+  },
+  "variables": {
+    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+  },
+  "resources": [
+    {
+      "type": "Microsoft.Resources/resourceGroups",
+      "name": "[parameters('resourceGroupName')]",
+      "location": "[parameters('resourceGroupLocation')]",
+      "apiVersion": "2019-10-01"
+    },
+    {
+      "type": "Microsoft.Resources/deployments",
+      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+      "resourceGroup": "[parameters('resourceGroupName')]",
+      "apiVersion": "2019-10-01",
+      "dependsOn": [
+        "[parameters('resourceGroupName')]"
+      ],
+      "properties": {
+        "mode": "Incremental",
+        "template": {
+          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+          "contentVersion": "1.0.0.0",
+          "resources": [
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[parameters('resourceName')]",
+              "type": "Microsoft.Web/sites",
+              "apiVersion": "2015-08-01",
+              "tags": {
+                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
+              },
+              "dependsOn": [
+                "[variables('appServicePlan_ResourceId')]"
+              ],
+              "kind": "app",
+              "properties": {
+                "name": "[parameters('resourceName')]",
+                "kind": "app",
+                "httpsOnly": true,
+                "reserved": false,
+                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
+                "siteConfig": {
+                  "metadata": [
+                    {
+                      "name": "CURRENT_STACK",
+                      "value": "dotnetcore"
+                    }
+                  ]
+                }
+              },
+              "identity": {
+                "type": "SystemAssigned"
+              }
+            },
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[variables('appServicePlan_name')]",
+              "type": "Microsoft.Web/serverFarms",
+              "apiVersion": "2015-08-01",
+              "sku": {
+                "name": "S1",
+                "tier": "Standard",
+                "family": "S",
+                "size": "S1"
+              },
+              "properties": {
+                "name": "[variables('appServicePlan_name')]"
+              }
+            }
+          ]
+        }
+      }
+    }
+  ]
+}

+ 18 - 0
Dotnet/Deathwatch/Shared/NavMenu.razor

@@ -32,6 +32,24 @@
                 <span class="oi oi-list-rich" aria-hidden="true"></span> Weapons
             </NavLink>
         </div>
+
+        <div class="nav-item px-3">
+            <NavLink class="nav-link" href="pouvoir-list">
+                <span class="oi oi-list-rich" aria-hidden="true"></span> Powers
+            </NavLink>
+        </div>
+
+        <div class="nav-item px-3">
+            <NavLink class="nav-link" href="competence-list">
+                <span class="oi oi-list-rich" aria-hidden="true"></span> Skills
+            </NavLink>
+        </div>
+
+        <div class="nav-item px-3">
+            <NavLink class="nav-link" href="trait-list">
+                <span class="oi oi-list-rich" aria-hidden="true"></span> Traits
+            </NavLink>
+        </div>
     </nav>
 </div>
 

+ 1 - 1
Dotnet/Domain/XML Model/Cybernétique.cs

@@ -29,7 +29,7 @@ namespace Domain.XML_Model
         public string? EffetQualitéExceptionnelle { get; set; }
 
         [XmlAttribute(AttributeName = "cout")]
-        public string Cout { get; set; }
+        public string? Cout { get; set; }
 
         [XmlAttribute(AttributeName = "disponibilité")]
         public string? Disponibilité { get; set; }