From 560f454c9beb2f691730b126fc6b3e23d68d6681 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sun, 30 Sep 2018 02:06:02 +0200 Subject: added mot of the database infrastructure --- DSACore/DSA_Game/Dsa.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'DSACore/DSA_Game/Dsa.cs') diff --git a/DSACore/DSA_Game/Dsa.cs b/DSACore/DSA_Game/Dsa.cs index d47c5b6..824872c 100644 --- a/DSACore/DSA_Game/Dsa.cs +++ b/DSACore/DSA_Game/Dsa.cs @@ -1,4 +1,5 @@ using System; +using DSACore.FireBase; using DSALib; using DSALib.Characters; using Microsoft.EntityFrameworkCore.Design; @@ -21,6 +22,8 @@ namespace DSACore.DSA_Game public static List Talente { get; set; } = new List(); + public static List Zauber { get; set; } = new List(); + public static Session Session { get @@ -51,12 +54,27 @@ namespace DSACore.DSA_Game Chars.Add(new Character(filename)); (Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0)) .Where(c => !Talente.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Talente.Add(v)); + (Chars.Last() as Character)?.Zauber.Select(x => new Zauber(x.Name, x.Probe, 0, x.Complexity)) + .Where(c => !Zauber.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Zauber.Add(v)); } Properties.Deserialize(rootPath+"Properties"); Properties.Serialize(rootPath + "Properties"); Talente = Talente.OrderBy(x => x.Name).ToList(); + Zauber = Zauber.OrderBy(x => x.Name).ToList(); + + /*foreach (var talent in Talente) + { + Database.AddTalent(new Models.Database.Talent(talent.Name, talent.Probe)); + } + + foreach (var talent in Zauber) + { + Database.AddSpell(new Models.Database.GeneralSpell(talent.Name, talent.Probe, talent.Complexity)); + }*/ + + Session = new Session { Chars = Chars.Select(x => SaveChar.FromICharacter(x)).ToList() -- cgit v1.2.3-54-g00ecf