diff options
author | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
---|---|---|
committer | Dennis Kobert <d-kobert@web.de> | 2019-06-11 23:38:13 +0200 |
commit | 2fa4a0e50ebfc97059c8b84dbd17e79f9afc8a8d (patch) | |
tree | c3b34ccb2737e347a73768536895cbbaab13cc01 /DiscoBot/DSA_Game/Dsa.cs | |
parent | ec991104f56e90d7bb2878da2fe6ed4e585dfc46 (diff) | |
parent | af74efccf8d21e6151022b71f3cacd3fa83024ee (diff) |
Merge branch 'rework-backend'
Diffstat (limited to 'DiscoBot/DSA_Game/Dsa.cs')
-rw-r--r-- | DiscoBot/DSA_Game/Dsa.cs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/DiscoBot/DSA_Game/Dsa.cs b/DiscoBot/DSA_Game/Dsa.cs deleted file mode 100644 index fd60c9a..0000000 --- a/DiscoBot/DSA_Game/Dsa.cs +++ /dev/null @@ -1,72 +0,0 @@ -using DSALib; -using DSALib.Characters; - -namespace DiscoBot.DSA_Game -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - - using DiscoBot.Audio; - using DiscoBot.Commands; - using DiscoBot.DSA_Game.Characters; - using DiscoBot.DSA_Game.Save; - - using Discord.Commands; - - public static class Dsa - { - private static Session s_session; - - public static ICommandContext GeneralContext { get; set; } - - public static AudioService Service { get; set; } - - public static List<ICharacter> Chars { get; set; } = new List<ICharacter>(); // list of all characters - - public static List<Talent> Talente { get; set; } = new List<Talent>(); - - public static Session Session - { - get - { - s_session.Chars = Chars.Select(x => SaveChar.FromICharacter(x)).ToList(); - return s_session; - } - - set - { - s_session = value; - foreach (var x in value.Chars) - { - Chars.Find(c => c.Name.Equals(x.Name)).Update(x); - } - } - } - - public static void Startup() - { - //new DiscoBot.Auxiliary.Calculator.StringSolver("1d100 - (1d200 + 1) * -50000").Solve(); - /*Session = new Session();*/ - // relation.Add("Papo", "Pump aus der Gosse"); - foreach (var filename in Directory.GetFiles("helden", "*.xml")) - { - Chars.Add(new Character(filename)); - (Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0)) - .Where(c => !Talente.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Talente.Add(v)); - } - - Properties.Deserialize(); - Properties.Serialize(); - - Talente = Talente.OrderBy(x => x.Name).ToList(); - Session = new Session - { - Chars = Chars.Select(x => SaveChar.FromICharacter(x)).ToList(), - GeneralContext = GeneralContext - }; - Session.Save(); - } - } -}
\ No newline at end of file |