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/Characters/Character.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'DSACore/DSA_Game/Characters/Character.cs') diff --git a/DSACore/DSA_Game/Characters/Character.cs b/DSACore/DSA_Game/Characters/Character.cs index 8fad2ef..247fc58 100644 --- a/DSACore/DSA_Game/Characters/Character.cs +++ b/DSACore/DSA_Game/Characters/Character.cs @@ -1,4 +1,5 @@ -using DSACore.Auxiliary; +using System.IO; +using DSACore.Auxiliary; using DSALib; using DSALib.Characters; @@ -28,7 +29,12 @@ namespace DSACore.DSA_Game.Characters public Character(string path) : this() { - this.Load(path); // load + this.Load(new MemoryStream(File.ReadAllBytes(path))); // load + this.Post_process(); // calculate derived values + } + public Character(MemoryStream stream) : this() + { + this.Load(stream); // load this.Post_process(); // calculate derived values } @@ -198,10 +204,11 @@ namespace DSACore.DSA_Game.Characters } + - private void Load(string path) + private void Load(MemoryStream stream) { - var reader = new XmlTextReader(path); + var reader = new XmlTextReader(stream); while (reader.Read()) { // read until he hits keywords -- cgit v1.2.3-54-g00ecf