diff options
author | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
---|---|---|
committer | uzvkl <dennis.kobert@student.kit.edu> | 2019-06-11 23:05:52 +0200 |
commit | e6181c24124d97f2fbc932b8a68311e625463156 (patch) | |
tree | c1f097c344ca266b7941c9668590b0fd35c7870a /DSALib/Commands/FileHandler.cs | |
parent | 2490ad5d31fe2ac778ff9303776f0e91f47a2862 (diff) |
Move dsa related stuff to subfolder
Diffstat (limited to 'DSALib/Commands/FileHandler.cs')
-rw-r--r-- | DSALib/Commands/FileHandler.cs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/DSALib/Commands/FileHandler.cs b/DSALib/Commands/FileHandler.cs deleted file mode 100644 index d117040..0000000 --- a/DSALib/Commands/FileHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using DSALib.DSA_Game; -using DSALib.DSA_Game.Characters; -using DSALib; -using DSALib.Models.Dsa; - -namespace DSALib.Commands -{ - public class FileHandler - { - public static string AddChar(ulong id, string url) - { - if (url == string.Empty) throw new ArgumentException("Es wurde keine Datei angehängt"); - - - if (!url.EndsWith(".xml")) throw new ArgumentException("Es wurde kein xml Held mitgeschickt"); - - using (var client = new WebClient()) - { - client.DownloadFile(url, "helden\\" + url.Split("/").Last()); - } - - Dsa.Chars.Add(new Character("helden\\" + url.Split("/").Last())); - (Dsa.Chars.Last() as Character)?.Talente.Select(x => new Talent(x.Name, x.Probe, 0)) - .Where(c => !Dsa.Talente.Exists(v => v.Name.Equals(c.Name))).ToList().ForEach(v => Dsa.Talente.Add(v)); - - return $"{url.Split("/").Last()} wurde erfolgreich gespeichert"; - } - } -}
\ No newline at end of file |