summaryrefslogtreecommitdiff
path: root/DSACore/DSA_Game/Characters/Character.cs
diff options
context:
space:
mode:
authorTrueKuehli <rctcoaster2000@hotmail.de>2018-09-30 16:26:42 +0200
committerTrueKuehli <rctcoaster2000@hotmail.de>2018-09-30 16:26:42 +0200
commitf3de85c77706e33b5072dd4b491ff76fdfebccd6 (patch)
treecc024e9a1b8ea081504fbd183fc48edf0ce3b875 /DSACore/DSA_Game/Characters/Character.cs
parent3a67ec1e4530f6b413228c2dc19dd90977ac381c (diff)
parent560f454c9beb2f691730b126fc6b3e23d68d6681 (diff)
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
Diffstat (limited to 'DSACore/DSA_Game/Characters/Character.cs')
-rw-r--r--DSACore/DSA_Game/Characters/Character.cs15
1 files changed, 11 insertions, 4 deletions
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