summaryrefslogtreecommitdiff
path: root/DSACore/DSA_Game/Characters
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-09-30 02:06:02 +0200
committerTrueDoctor <d-kobert@web.de>2018-09-30 02:06:02 +0200
commit560f454c9beb2f691730b126fc6b3e23d68d6681 (patch)
tree944ac498da2d3d231ef928769c55bf29a39070d0 /DSACore/DSA_Game/Characters
parent7db0e121521733273a8ca3977e91e6f88756f38a (diff)
added mot of the database infrastructure
Diffstat (limited to 'DSACore/DSA_Game/Characters')
-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