From e6181c24124d97f2fbc932b8a68311e625463156 Mon Sep 17 00:00:00 2001 From: uzvkl Date: Tue, 11 Jun 2019 23:05:52 +0200 Subject: Move dsa related stuff to subfolder --- dsa/DSALib/DSA_Game/Characters/SaveChar.cs | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 dsa/DSALib/DSA_Game/Characters/SaveChar.cs (limited to 'dsa/DSALib/DSA_Game/Characters/SaveChar.cs') diff --git a/dsa/DSALib/DSA_Game/Characters/SaveChar.cs b/dsa/DSALib/DSA_Game/Characters/SaveChar.cs new file mode 100644 index 0000000..00e2f86 --- /dev/null +++ b/dsa/DSALib/DSA_Game/Characters/SaveChar.cs @@ -0,0 +1,38 @@ +using DSALib.Characters; + +namespace DSALib.DSA_Game.Characters +{ + public class SaveChar + { + public string Name { get; set; } + + public int Lebenspunkte_Aktuell { get; set; } + + public int Ausdauer_Aktuell { get; set; } + + public int Astralpunkte_Aktuell { get; set; } + + public static SaveChar FromICharacter(ICharacter c) + { + return new SaveChar + { + Astralpunkte_Aktuell = c.Astralpunkte_Aktuell, + Ausdauer_Aktuell = c.Ausdauer_Aktuell, + Lebenspunkte_Aktuell = c.Lebenspunkte_Aktuell, + Name = c.Name + }; + } + } + + + public static class ICharExtension + { + public static void Update(this ICharacter c, SaveChar s) + { + c.Astralpunkte_Aktuell = s.Astralpunkte_Aktuell; + c.Ausdauer_Aktuell = s.Ausdauer_Aktuell; + c.Lebenspunkte_Aktuell = s.Lebenspunkte_Aktuell; + c.Name = s.Name; + } + } +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf