diff options
author | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-30 16:26:42 +0200 |
---|---|---|
committer | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-30 16:26:42 +0200 |
commit | f3de85c77706e33b5072dd4b491ff76fdfebccd6 (patch) | |
tree | cc024e9a1b8ea081504fbd183fc48edf0ce3b875 /DSACore/Models/Database/DatabaseChar.cs | |
parent | 3a67ec1e4530f6b413228c2dc19dd90977ac381c (diff) | |
parent | 560f454c9beb2f691730b126fc6b3e23d68d6681 (diff) |
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
Diffstat (limited to 'DSACore/Models/Database/DatabaseChar.cs')
-rw-r--r-- | DSACore/Models/Database/DatabaseChar.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/DSACore/Models/Database/DatabaseChar.cs b/DSACore/Models/Database/DatabaseChar.cs new file mode 100644 index 0000000..03383b8 --- /dev/null +++ b/DSACore/Models/Database/DatabaseChar.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using DSALib; + +namespace DSACore.Models.Database +{ + public class DatabaseChar + { + public int Id { get; set; } + + public string Name { get; set; } + + public string Rasse { get; set; } + + public List<Field> Skills { get; set; } = new List<Field>(); + + public List<Field> Talents { get; set; } = new List<Field>(); + + public List<Advantage> Advantages { get; set; } = new List<Advantage>(); + + public List<CharSpell> Spells { get; set; } = new List<CharSpell>(); + + public List<WeaponTalent> WeaponTalents { get; set; } = new List<WeaponTalent>(); + + + public static void LoadChar(DSA_Game.Characters.Character file, out GroupChar group, out DatabaseChar data) + { + group = new GroupChar(); + data = new DatabaseChar(); + + group.Name = file.Name.Split(' ').First(); + group.Weapon = new Weapon(); + group.Lp = group.LpMax = file.Lebenspunkte_Basis; + group.As = group.AsMax = file.Astralpunkte_Basis; + group.Weapon = new Weapon(); + + data.Name = file.Name; + data.Advantages = file.Vorteile.Select(x => new Advantage(x.Name, x.Value)).ToList(); + data.Skills = file.Eigenschaften.Select(x => new Field(x.Key, x.Value)).ToList(); + data.Spells = file.Zauber.Select(x => new CharSpell(x.Representation, x.Value)).ToList(); + data.Talents = file.Talente.Select(x => new Field(x.Name, x.Value)).ToList(); + data.WeaponTalents = file.Kampftalente.Select(x => new WeaponTalent(x.Name, x.At, x.Pa)).ToList(); + } + } +} |