USRINGENICO\fmorel 3 anni fa
parent
commit
a0cf2839be

+ 10 - 2
.vs/VSWorkspaceState.json

@@ -1,7 +1,15 @@
 {
   "ExpandedNodes": [
-    ""
+    "",
+    "\\Dotnet",
+    "\\Dotnet\\Warhammer",
+    "\\Dotnet\\Warhammer\\DAL",
+    "\\Dotnet\\Warhammer\\DAL\\Database",
+    "\\Dotnet\\Warhammer\\Models",
+    "\\Dotnet\\Warhammer\\Models\\Enum",
+    "\\Dotnet\\Warhammer\\Views",
+    "\\Dotnet\\Warhammer\\Views\\Shared"
   ],
-  "SelectedNode": "\\C:\\Repositories\\Warhammer\\Deathwatch",
+  "SelectedNode": "\\Dotnet\\Warhammer\\Models\\Player.cs",
   "PreviewInSolutionExplorer": false
 }

BIN
.vs/slnx.sqlite


+ 83 - 0
Dotnet/Warhammer/Controllers/PlayerController.cs

@@ -0,0 +1,83 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Warhammer.Controllers
+{
+    public class PlayerController : Controller
+    {
+        // GET: PlayerController
+        public ActionResult Index()
+        {
+            return View();
+        }
+
+        // GET: PlayerController/Details/5
+        public ActionResult Details(int id)
+        {
+            return View();
+        }
+
+        // GET: PlayerController/Create
+        public ActionResult Create()
+        {
+            return View();
+        }
+
+        // POST: PlayerController/Create
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create(IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(Index));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+
+        // GET: PlayerController/Edit/5
+        public ActionResult Edit(int id)
+        {
+            return View();
+        }
+
+        // POST: PlayerController/Edit/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(int id, IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(Index));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+
+        // GET: PlayerController/Delete/5
+        public ActionResult Delete(int id)
+        {
+            return View();
+        }
+
+        // POST: PlayerController/Delete/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Delete(int id, IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(Index));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+    }
+}

+ 9 - 0
Dotnet/Warhammer/DAL/Database/DeathwatchDbContext.cs

@@ -0,0 +1,9 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace Warhammer.DAL.Database
+{
+    public class DeathwatchDbContext : DbContext
+    {
+
+    }
+}

+ 59 - 0
Dotnet/Warhammer/Models/Enum/Enum.cs

@@ -0,0 +1,59 @@
+using System.ComponentModel;
+
+namespace Warhammer.Models.Enum
+{
+    public enum WeaponClass
+    {
+        [Description("Pistol")]
+        PISTOL,
+        [Description("Basic")]
+        BASIC,
+        [Description("Heavy")]
+        HEAVY,
+        [Description("Thrown")]
+        THROWN,
+        [Description("Melee")]
+        MELEE
+    }
+
+    public enum ItemAvailibility
+    {
+        [Description("Automatic")]
+        UBIQUITOUS = 100,
+        [Description("Easy")]
+        ABUNDANT = 30,
+        [Description("Routine")]
+        PLENTIFUL = 20,
+        [Description("Ordinary")]
+        COMMON = 10,
+        [Description("Challenging")]
+        AVERAGE = 0,
+        [Description("Difficult")]
+        SCARCE = -10,
+        [Description("Hard")]
+        RARE = -20,
+        [Description("Very Hard")]
+        VERY_RARE = -30,
+        [Description("Arduous ")]
+        EXTREMELY_RARE = -40,
+        [Description("Punishing ")]
+        NEAR_UNIQUE = -50,
+        [Description("Hellish")]
+        UNIQUE = -60
+    }
+
+    public enum OrganisationLevel
+    {
+        [Description("Local Influence")]
+        LOCAL,
+        [Description("Regional Influence")]
+        REGIONAL,
+        [Description("National Influence")]
+        NATIONAL,
+        [Description("All the Planet")]
+        PLANETARY,
+        [Description("All the galaxy & beyond")]
+        INTERGALACTICAL
+    }
+
+}

+ 5 - 1
Dotnet/Warhammer/Models/Player.cs

@@ -1,7 +1,11 @@
-namespace Warhammer.Models
+using System.ComponentModel.DataAnnotations;
+
+namespace Warhammer.Models
 {
     public class Player
     {
+        [Key]
+        public string Name { get; set; }
         public int Experience { get; set; }
         public int CC { get; set; }
         public int CT { get; set; }

+ 13 - 0
Dotnet/Warhammer/Models/Weapon.cs

@@ -0,0 +1,13 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Warhammer.Models
+{
+    public class Weapon
+    {
+        [Key]
+        public int id { get; set; }
+        public int Range { get; set; }
+        public string Name { get; set; }
+        
+    }
+}

+ 1 - 0
Dotnet/Warhammer/Warhammer.csproj

@@ -7,6 +7,7 @@
 
   <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.23" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
     <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
   </ItemGroup>