summaryrefslogtreecommitdiff
path: root/DSACore/Models
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 17:58:42 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 17:58:42 +0200
commit2ab4051c6fe720dc47e99b0c305a0d779ee02d51 (patch)
tree9510ddbb174a54474934adf7991a5ba2aa39f818 /DSACore/Models
parentc4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff)
Moved Gamelogic to DSALib
Diffstat (limited to 'DSACore/Models')
-rw-r--r--DSACore/Models/Database/DSA/Advantage.cs16
-rw-r--r--DSACore/Models/Database/DSA/CharSpell.cs16
-rw-r--r--DSACore/Models/Database/DSA/DatabaseChar.cs63
-rw-r--r--DSACore/Models/Database/DSA/Field.cs16
-rw-r--r--DSACore/Models/Database/DSA/GeneralSpell.cs20
-rw-r--r--DSACore/Models/Database/DSA/GroupChar.cs13
-rw-r--r--DSACore/Models/Database/DSA/Inventory.cs12
-rw-r--r--DSACore/Models/Database/DSA/Talent.cs26
-rw-r--r--DSACore/Models/Database/DSA/Weapon.cs52
-rw-r--r--DSACore/Models/Database/DSA/WeaponTalent.cs18
-rw-r--r--DSACore/Models/Database/Groups/DSAGroup.cs10
-rw-r--r--DSACore/Models/Database/Groups/Group.cs10
-rw-r--r--DSACore/Models/Network/Command.cs18
-rw-r--r--DSACore/Models/Network/CommandResponse.cs28
-rw-r--r--DSACore/Models/Network/Group.cs43
-rw-r--r--DSACore/Models/Network/Token.cs21
-rw-r--r--DSACore/Models/Network/User.cs9
17 files changed, 0 insertions, 391 deletions
diff --git a/DSACore/Models/Database/DSA/Advantage.cs b/DSACore/Models/Database/DSA/Advantage.cs
deleted file mode 100644
index cc8f5cc..0000000
--- a/DSACore/Models/Database/DSA/Advantage.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class Advantage
- {
- public Advantage(string name, string value = "")
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- Value = value ?? throw new ArgumentNullException(nameof(value));
- }
-
- public string Name { get; set; }
- public string Value { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/CharSpell.cs b/DSACore/Models/Database/DSA/CharSpell.cs
deleted file mode 100644
index fabd456..0000000
--- a/DSACore/Models/Database/DSA/CharSpell.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class CharSpell
- {
- public CharSpell(string representation, int value)
- {
- this.representation = representation ?? throw new ArgumentNullException(nameof(representation));
- this.value = value;
- }
-
- public string representation { get; set; }
- public int value { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/DatabaseChar.cs b/DSACore/Models/Database/DSA/DatabaseChar.cs
deleted file mode 100644
index 872b82e..0000000
--- a/DSACore/Models/Database/DSA/DatabaseChar.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using DSACore.DSA_Game.Characters;
-
-namespace DSACore.Models.Database.DSA
-{
- public class DatabaseChar
- {
- public DatabaseChar()
- {
- }
-
- public DatabaseChar(int id, string name, string rasse, List<Field> skills, List<Field> talents,
- List<Advantage> advantages, List<CharSpell> spells, List<WeaponTalent> weaponTalents)
- {
- Id = id;
- Name = name ?? throw new ArgumentNullException(nameof(name));
- Rasse = rasse ?? throw new ArgumentNullException(nameof(rasse));
- Skills = skills ?? throw new ArgumentNullException(nameof(skills));
- Talents = talents ?? throw new ArgumentNullException(nameof(talents));
- Advantages = advantages ?? throw new ArgumentNullException(nameof(advantages));
- Spells = spells ?? throw new ArgumentNullException(nameof(spells));
- WeaponTalents = weaponTalents ?? throw new ArgumentNullException(nameof(weaponTalents));
- }
-
- 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(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();
- }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/Field.cs b/DSACore/Models/Database/DSA/Field.cs
deleted file mode 100644
index e63aeb4..0000000
--- a/DSACore/Models/Database/DSA/Field.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class Field
- {
- public Field(string name, int value = 0)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- Value = value;
- }
-
- public string Name { get; set; }
- public int Value { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/GeneralSpell.cs b/DSACore/Models/Database/DSA/GeneralSpell.cs
deleted file mode 100644
index b4dbc0b..0000000
--- a/DSACore/Models/Database/DSA/GeneralSpell.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace DSACore.Models.Database.DSA
-{
- public class GeneralSpell : Talent
- {
- public char Comlexity = 'A';
-
- public GeneralSpell(string name, string roll, char comlexity = 'A') : base(name, roll)
- {
- Comlexity = comlexity;
- }
-
- public GeneralSpell(string name, string roll) : base(name, roll)
- {
- }
-
- public GeneralSpell()
- {
- }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/GroupChar.cs b/DSACore/Models/Database/DSA/GroupChar.cs
deleted file mode 100644
index 31fc583..0000000
--- a/DSACore/Models/Database/DSA/GroupChar.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace DSACore.Models.Database.DSA
-{
- public class GroupChar
- {
- public string Name { get; set; }
- public int Id { get; set; }
- public int Lp { get; set; }
- public int LpMax { get; set; }
- public int As { get; set; }
- public int AsMax { get; set; }
- public Weapon Weapon { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/Inventory.cs b/DSACore/Models/Database/DSA/Inventory.cs
deleted file mode 100644
index 9a025d4..0000000
--- a/DSACore/Models/Database/DSA/Inventory.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Collections.Generic;
-
-namespace DSACore.Models.Database.DSA
-{
- public class Inventory
- {
- public int Id { get; set; }
- public Dictionary<string, bool> Items { get; set; } = new Dictionary<string, bool>();
- public Dictionary<string, bool> Food { get; set; } = new Dictionary<string, bool>();
- public List<Weapon> Weapons { get; set; } = new List<Weapon>();
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/Talent.cs b/DSACore/Models/Database/DSA/Talent.cs
deleted file mode 100644
index 59ff4bc..0000000
--- a/DSACore/Models/Database/DSA/Talent.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class Talent
- {
- public Talent()
- {
- }
-
- public Talent(string name)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- }
-
- public Talent(string name, string roll)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- Roll = roll.Split('/');
- }
-
- public string Name { get; set; }
-
- public string[] Roll { get; set; } = new string[3];
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/Weapon.cs b/DSACore/Models/Database/DSA/Weapon.cs
deleted file mode 100644
index 58a44cd..0000000
--- a/DSACore/Models/Database/DSA/Weapon.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class Weapon
- {
- public Weapon()
- {
- }
-
- public Weapon(string name, string damage, int weight, string weaponTalent, string price)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- Damage = damage ?? throw new ArgumentNullException(nameof(damage));
- Weight = weight;
- WeaponTalent = weaponTalent ?? throw new ArgumentNullException(nameof(weaponTalent));
- Price = price;
- }
-
- public string Name { get; set; }
- public string Damage { get; set; }
- public int Weight { get; set; }
- public string WeaponTalent { get; set; }
- public string Price { get; set; }
- }
-
- public class MeleeWeapon : Weapon
- {
- public MeleeWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name,
- damage, weight, weaponTalent, price)
- {
- }
-
- public string TpKK { get; set; }
- public int INI { get; set; }
- public string MW { get; set; }
- }
-
- public class RangedWeapon : Weapon
- {
- public RangedWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name,
- damage, weight, weaponTalent, price)
- {
- }
-
- public int AtMod { get; set; }
- public int KKMod { get; set; }
- public string AtReach { get; set; }
- public string TpReach { get; set; }
- public int LoadTime { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/DSA/WeaponTalent.cs b/DSACore/Models/Database/DSA/WeaponTalent.cs
deleted file mode 100644
index 98eb38d..0000000
--- a/DSACore/Models/Database/DSA/WeaponTalent.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-
-namespace DSACore.Models.Database.DSA
-{
- public class WeaponTalent
- {
- public WeaponTalent(string name, int at, int pa)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- At = at;
- Pa = pa;
- }
-
- public string Name { get; set; }
- public int At { get; set; }
- public int Pa { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/Groups/DSAGroup.cs b/DSACore/Models/Database/Groups/DSAGroup.cs
deleted file mode 100644
index 89fac2f..0000000
--- a/DSACore/Models/Database/Groups/DSAGroup.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System.Collections.Generic;
-using DSACore.Models.Database.DSA;
-
-namespace DSACore.Models.Database.Groups
-{
- public class DSAGroup : Group
- {
- public List<GroupChar> Chars { get; set; } = new List<GroupChar>();
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Database/Groups/Group.cs b/DSACore/Models/Database/Groups/Group.cs
deleted file mode 100644
index 77d3a64..0000000
--- a/DSACore/Models/Database/Groups/Group.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace DSACore.Models.Database.Groups
-{
- public class Group
- {
- public string Name { get; set; }
- public string Discord { get; set; }
- public string Password { get; set; }
- public int Id { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Network/Command.cs b/DSACore/Models/Network/Command.cs
deleted file mode 100644
index 00b00a6..0000000
--- a/DSACore/Models/Network/Command.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace DSACore.Models.Network
-{
- public class Command
- {
- public ulong GroupId { get; set; } = 0;
- public ulong CharId { get; set; }
- public string Name { get; set; }
- public string CmdIdentifier { get; set; }
- public List<string> CmdTexts { get; set; }
- public string CmdText => CmdTexts.Count != 0 ? CmdTexts.First() : "";
-
- public int Cmdmodifier => CmdTexts.Count != 0 && int.TryParse(CmdTexts.Last(), out var mod) ? mod : 0;
- public bool IsDm { get; set; } = false;
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Network/CommandResponse.cs b/DSACore/Models/Network/CommandResponse.cs
deleted file mode 100644
index c7a410a..0000000
--- a/DSACore/Models/Network/CommandResponse.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-namespace DSACore.Models.Network
-{
- public class CommandResponse
- {
- public CommandResponse(string message, ResponseType responseType = ResponseType.Broadcast)
- {
- this.message = message ?? throw new ArgumentNullException(nameof(message));
- ResponseType = responseType;
- }
-
- public string message { get; }
- public ResponseType ResponseType { get; }
-
- public override string ToString()
- {
- return message;
- }
- }
-
- public enum ResponseType
- {
- Broadcast,
- Caller,
- Error
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs
deleted file mode 100644
index efe12ee..0000000
--- a/DSACore/Models/Network/Group.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace DSACore.Models.Network
-{
- public class Group
- {
- public Group(string name, string password)
- {
- Name = name;
- Password = password;
- }
-
- public Group(string name, int userOnline)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- }
-
- public string Name { get; set; }
- public string Password { get; set; }
- public List<User> Users { get; set; } = new List<User>();
-
- public int UserCount => Users.Count;
-
- public SendGroup SendGroup()
- {
- return new SendGroup(Name, UserCount);
- }
- }
-
- public class SendGroup
- {
- public SendGroup(string name, int userCount)
- {
- Name = name ?? throw new ArgumentNullException(nameof(name));
- UserCount = userCount;
- }
-
- public string Name { get; set; }
-
- public int UserCount { get; set; }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Network/Token.cs b/DSACore/Models/Network/Token.cs
deleted file mode 100644
index 451cafc..0000000
--- a/DSACore/Models/Network/Token.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-
-namespace DSACore.Models.Network
-{
- public class Token
- {
- private readonly DateTime creation = DateTime.Now;
-
- public Token(string group)
- {
- Group = group;
- }
-
- public string Group { get; set; }
-
- public bool IsValid()
- {
- return DateTime.Now - creation < TimeSpan.FromMinutes(1);
- }
- }
-} \ No newline at end of file
diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs
deleted file mode 100644
index 8b8008c..0000000
--- a/DSACore/Models/Network/User.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace DSACore.Models.Network
-{
- public class User
- {
- public string Name { get; set; }
- public string ConnectionId { get; set; }
- public int Char { get; set; }
- }
-} \ No newline at end of file