diff options
author | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
commit | 1509b5ef3d7e9e71d9294e234ec0e39f2d831998 (patch) | |
tree | 78300ffff230958101b422a4e6026925b287822f /DSACore/Models | |
parent | c3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff) | |
parent | c4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff) |
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DSACore/Models')
-rw-r--r-- | DSACore/Models/Database/DSA/Advantage.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/CharSpell.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/DatabaseChar.cs | 8 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/Field.cs | 4 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/GeneralSpell.cs | 4 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/GroupChar.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/Inventory.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/Talent.cs | 4 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/Weapon.cs | 20 | ||||
-rw-r--r-- | DSACore/Models/Database/DSA/WeaponTalent.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/Groups/DSAGroup.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/Groups/Group.cs | 5 | ||||
-rw-r--r-- | DSACore/Models/Network/Command.cs | 8 | ||||
-rw-r--r-- | DSACore/Models/Network/CommandResponse.cs | 11 | ||||
-rw-r--r-- | DSACore/Models/Network/Group.cs | 12 | ||||
-rw-r--r-- | DSACore/Models/Network/Token.cs | 10 | ||||
-rw-r--r-- | DSACore/Models/Network/User.cs | 9 |
17 files changed, 46 insertions, 61 deletions
diff --git a/DSACore/Models/Database/DSA/Advantage.cs b/DSACore/Models/Database/DSA/Advantage.cs index 2f0b443..cc8f5cc 100644 --- a/DSACore/Models/Database/DSA/Advantage.cs +++ b/DSACore/Models/Database/DSA/Advantage.cs @@ -13,4 +13,4 @@ namespace DSACore.Models.Database.DSA 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 index 63d917a..fabd456 100644 --- a/DSACore/Models/Database/DSA/CharSpell.cs +++ b/DSACore/Models/Database/DSA/CharSpell.cs @@ -13,4 +13,4 @@ namespace DSACore.Models.Database.DSA 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 index 8c51821..872b82e 100644 --- a/DSACore/Models/Database/DSA/DatabaseChar.cs +++ b/DSACore/Models/Database/DSA/DatabaseChar.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using DSACore.DSA_Game.Characters; namespace DSACore.Models.Database.DSA { @@ -10,7 +11,8 @@ namespace DSACore.Models.Database.DSA { } - public DatabaseChar(int id, string name, string rasse, List<Field> skills, List<Field> talents, List<Advantage> advantages, List<CharSpell> spells, List<WeaponTalent> weaponTalents) + 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)); @@ -39,7 +41,7 @@ namespace DSACore.Models.Database.DSA public List<WeaponTalent> WeaponTalents { get; set; } = new List<WeaponTalent>(); - public static void LoadChar(DSA_Game.Characters.Character file, out GroupChar group, out DatabaseChar data) + public static void LoadChar(Character file, out GroupChar group, out DatabaseChar data) { group = new GroupChar(); data = new DatabaseChar(); @@ -58,4 +60,4 @@ namespace DSACore.Models.Database.DSA 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 index 5022768..e63aeb4 100644 --- a/DSACore/Models/Database/DSA/Field.cs +++ b/DSACore/Models/Database/DSA/Field.cs @@ -7,10 +7,10 @@ namespace DSACore.Models.Database.DSA public Field(string name, int value = 0) { Name = name ?? throw new ArgumentNullException(nameof(name)); - this.Value = value; + 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 index 74b95d7..b4dbc0b 100644 --- a/DSACore/Models/Database/DSA/GeneralSpell.cs +++ b/DSACore/Models/Database/DSA/GeneralSpell.cs @@ -4,7 +4,7 @@ { public char Comlexity = 'A'; - public GeneralSpell(string name, string roll, char comlexity = 'A') :base(name, roll) + public GeneralSpell(string name, string roll, char comlexity = 'A') : base(name, roll) { Comlexity = comlexity; } @@ -17,4 +17,4 @@ { } } -} +}
\ No newline at end of file diff --git a/DSACore/Models/Database/DSA/GroupChar.cs b/DSACore/Models/Database/DSA/GroupChar.cs index 70b8fc1..31fc583 100644 --- a/DSACore/Models/Database/DSA/GroupChar.cs +++ b/DSACore/Models/Database/DSA/GroupChar.cs @@ -10,4 +10,4 @@ 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 index 69c7b08..9a025d4 100644 --- a/DSACore/Models/Database/DSA/Inventory.cs +++ b/DSACore/Models/Database/DSA/Inventory.cs @@ -9,4 +9,4 @@ namespace DSACore.Models.Database.DSA 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 index a6de395..59ff4bc 100644 --- a/DSACore/Models/Database/DSA/Talent.cs +++ b/DSACore/Models/Database/DSA/Talent.cs @@ -13,7 +13,7 @@ namespace DSACore.Models.Database.DSA Name = name ?? throw new ArgumentNullException(nameof(name)); } - public Talent(string name, String roll) + public Talent(string name, string roll) { Name = name ?? throw new ArgumentNullException(nameof(name)); Roll = roll.Split('/'); @@ -23,4 +23,4 @@ namespace DSACore.Models.Database.DSA 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 index 24b334a..58a44cd 100644 --- a/DSACore/Models/Database/DSA/Weapon.cs +++ b/DSACore/Models/Database/DSA/Weapon.cs @@ -26,25 +26,27 @@ namespace DSACore.Models.Database.DSA 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 MeleeWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, damage, weight, weaponTalent, price) - { - } } 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; } - - public RangedWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, damage, weight, weaponTalent, price) - { - } } -} +}
\ No newline at end of file diff --git a/DSACore/Models/Database/DSA/WeaponTalent.cs b/DSACore/Models/Database/DSA/WeaponTalent.cs index 869cb35..98eb38d 100644 --- a/DSACore/Models/Database/DSA/WeaponTalent.cs +++ b/DSACore/Models/Database/DSA/WeaponTalent.cs @@ -2,7 +2,7 @@ namespace DSACore.Models.Database.DSA { - public class WeaponTalent + public class WeaponTalent { public WeaponTalent(string name, int at, int pa) { diff --git a/DSACore/Models/Database/Groups/DSAGroup.cs b/DSACore/Models/Database/Groups/DSAGroup.cs index 8f20278..89fac2f 100644 --- a/DSACore/Models/Database/Groups/DSAGroup.cs +++ b/DSACore/Models/Database/Groups/DSAGroup.cs @@ -5,6 +5,6 @@ namespace DSACore.Models.Database.Groups { public class DSAGroup : Group { - public List<GroupChar> Chars { get; set; }= new List<GroupChar>(); + 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 index 23e5f68..77d3a64 100644 --- a/DSACore/Models/Database/Groups/Group.cs +++ b/DSACore/Models/Database/Groups/Group.cs @@ -6,8 +6,5 @@ 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 index 456a896..00b00a6 100644 --- a/DSACore/Models/Network/Command.cs +++ b/DSACore/Models/Network/Command.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { @@ -14,7 +12,7 @@ namespace DSACore.Models.Network 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 int mod) ? mod : 0; + 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 index ed4b7d0..c7a410a 100644 --- a/DSACore/Models/Network/CommandResponse.cs +++ b/DSACore/Models/Network/CommandResponse.cs @@ -1,20 +1,17 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { public class CommandResponse { - public CommandResponse(string message, ResponseType responseType= ResponseType.Broadcast) + public CommandResponse(string message, ResponseType responseType = ResponseType.Broadcast) { this.message = message ?? throw new ArgumentNullException(nameof(message)); ResponseType = responseType; } - public string message { get; private set; } - public ResponseType ResponseType { get; private set;} + public string message { get; } + public ResponseType ResponseType { get; } public override string ToString() { @@ -28,4 +25,4 @@ namespace DSACore.Models.Network Caller, Error } -} +}
\ No newline at end of file diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs index 76c3efb..efe12ee 100644 --- a/DSACore/Models/Network/Group.cs +++ b/DSACore/Models/Network/Group.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace DSACore.Models.Network { @@ -22,14 +20,11 @@ namespace DSACore.Models.Network public string Password { get; set; } public List<User> Users { get; set; } = new List<User>(); - public int UserCount - { - get { return Users.Count; } - } + public int UserCount => Users.Count; public SendGroup SendGroup() { - return new SendGroup( Name, UserCount); + return new SendGroup(Name, UserCount); } } @@ -44,6 +39,5 @@ namespace DSACore.Models.Network 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 index 0021317..451cafc 100644 --- a/DSACore/Models/Network/Token.cs +++ b/DSACore/Models/Network/Token.cs @@ -1,18 +1,18 @@ using System; -using Microsoft.EntityFrameworkCore; namespace DSACore.Models.Network { public class Token { - public string Group { get; set; } - private DateTime creation = DateTime.Now; + private readonly DateTime creation = DateTime.Now; - public Token(string @group) + public Token(string group) { - Group = @group; + Group = group; } + public string Group { get; set; } + public bool IsValid() { return DateTime.Now - creation < TimeSpan.FromMinutes(1); diff --git a/DSACore/Models/Network/User.cs b/DSACore/Models/Network/User.cs index 04ef0a9..8b8008c 100644 --- a/DSACore/Models/Network/User.cs +++ b/DSACore/Models/Network/User.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace DSACore.Models.Network +namespace DSACore.Models.Network { public class User { @@ -11,4 +6,4 @@ namespace DSACore.Models.Network public string ConnectionId { get; set; } public int Char { get; set; } } -} +}
\ No newline at end of file |