diff options
Diffstat (limited to 'DSACore/DSA_Game/Characters/SaveChar.cs')
-rw-r--r-- | DSACore/DSA_Game/Characters/SaveChar.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/DSACore/DSA_Game/Characters/SaveChar.cs b/DSACore/DSA_Game/Characters/SaveChar.cs new file mode 100644 index 0000000..50cb91c --- /dev/null +++ b/DSACore/DSA_Game/Characters/SaveChar.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using DSALib.Characters; + +namespace DiscoBot.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; + } + } +} |