From 304437b834e8c87687f68333ae67a13ee1377a73 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 12 Jun 2019 21:47:51 +0200 Subject: Adjust Codestyle --- dsa/DSALib/Models/Database/DataObject.cs | 14 +++++--------- dsa/DSALib/Models/Database/Dsa/Advantage.cs | 9 +++------ dsa/DSALib/Models/Database/Dsa/CharSpell.cs | 9 +++------ dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs | 15 +++++---------- dsa/DSALib/Models/Database/Dsa/Field.cs | 9 +++------ dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs | 15 +++++---------- dsa/DSALib/Models/Database/Dsa/GroupChar.cs | 6 ++---- dsa/DSALib/Models/Database/Dsa/Inventory.cs | 6 ++---- dsa/DSALib/Models/Database/Dsa/Talent.cs | 15 +++++---------- dsa/DSALib/Models/Database/Dsa/Weapon.cs | 24 ++++++++---------------- dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs | 9 +++------ dsa/DSALib/Models/Database/Groups/DSAGroup.cs | 6 ++---- dsa/DSALib/Models/Database/Groups/Group.cs | 6 ++---- dsa/DSALib/Models/Database/IDataObject.cs | 6 ++---- dsa/DSALib/Models/Dsa/CritterAttack.cs | 11 +++++------ dsa/DSALib/Models/Dsa/KampfTalent.cs | 11 +++++------ dsa/DSALib/Models/Dsa/Talent.cs | 16 +++++++--------- dsa/DSALib/Models/Dsa/Vorteil.cs | 10 +++++----- dsa/DSALib/Models/Dsa/Zauber.cs | 9 +++------ dsa/DSALib/Models/Network/Command.cs | 6 ++---- dsa/DSALib/Models/Network/CommandResponse.cs | 15 +++++---------- 21 files changed, 82 insertions(+), 145 deletions(-) (limited to 'dsa/DSALib/Models') diff --git a/dsa/DSALib/Models/Database/DataObject.cs b/dsa/DSALib/Models/Database/DataObject.cs index 59cfdf2..ca6d6b2 100644 --- a/dsa/DSALib/Models/Database/DataObject.cs +++ b/dsa/DSALib/Models/Database/DataObject.cs @@ -1,13 +1,9 @@ -namespace DSALib.Models.Database -{ - public class DataObject : IDataObject - { +namespace DSALib.Models.Database { + public class DataObject : IDataObject { + public string Name { get; set; } - public override string ToString() - { + public override string ToString() { return Name; } - - public string Name { get; set; } } -} +} \ No newline at end of file diff --git a/dsa/DSALib/Models/Database/Dsa/Advantage.cs b/dsa/DSALib/Models/Database/Dsa/Advantage.cs index 2ed0bf9..1a3d40b 100644 --- a/dsa/DSALib/Models/Database/Dsa/Advantage.cs +++ b/dsa/DSALib/Models/Database/Dsa/Advantage.cs @@ -1,11 +1,8 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class Advantage - { - public Advantage(string name, string value = "") - { +namespace DSALib.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)); } diff --git a/dsa/DSALib/Models/Database/Dsa/CharSpell.cs b/dsa/DSALib/Models/Database/Dsa/CharSpell.cs index d08bc74..4486004 100644 --- a/dsa/DSALib/Models/Database/Dsa/CharSpell.cs +++ b/dsa/DSALib/Models/Database/Dsa/CharSpell.cs @@ -1,11 +1,8 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class CharSpell - { - public CharSpell(string representation, int value) - { +namespace DSALib.Models.Database.Dsa { + public class CharSpell { + public CharSpell(string representation, int value) { this.representation = representation ?? throw new ArgumentNullException(nameof(representation)); this.value = value; } diff --git a/dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs b/dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs index 1312f95..2b163a4 100644 --- a/dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs +++ b/dsa/DSALib/Models/Database/Dsa/DatabaseChar.cs @@ -3,17 +3,13 @@ using System.Collections.Generic; using System.Linq; using DSALib.DSA_Game.Characters; -namespace DSALib.Models.Database.Dsa -{ - public class DatabaseChar - { - public DatabaseChar() - { +namespace DSALib.Models.Database.Dsa { + public class DatabaseChar { + public DatabaseChar() { } public DatabaseChar(int id, string name, string rasse, List skills, List talents, - List advantages, List spells, List weaponTalents) - { + List advantages, List spells, List weaponTalents) { Id = id; Name = name ?? throw new ArgumentNullException(nameof(name)); Race = rasse ?? throw new ArgumentNullException(nameof(rasse)); @@ -41,8 +37,7 @@ namespace DSALib.Models.Database.Dsa public List WeaponTalents { get; set; } = new List(); - public static void LoadChar(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(); diff --git a/dsa/DSALib/Models/Database/Dsa/Field.cs b/dsa/DSALib/Models/Database/Dsa/Field.cs index 6d1b82e..f720318 100644 --- a/dsa/DSALib/Models/Database/Dsa/Field.cs +++ b/dsa/DSALib/Models/Database/Dsa/Field.cs @@ -1,11 +1,8 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class Field - { - public Field(string name, int value = 0) - { +namespace DSALib.Models.Database.Dsa { + public class Field { + public Field(string name, int value = 0) { Name = name ?? throw new ArgumentNullException(nameof(name)); Value = value; } diff --git a/dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs b/dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs index 964c38e..6e1ecf1 100644 --- a/dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs +++ b/dsa/DSALib/Models/Database/Dsa/GeneralSpell.cs @@ -1,20 +1,15 @@ -namespace DSALib.Models.Database.Dsa -{ - public class GeneralSpell : Talent - { +namespace DSALib.Models.Database.Dsa { + public class GeneralSpell : Talent { 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; } - public GeneralSpell(string name, string roll) : base(name, roll) - { + public GeneralSpell(string name, string roll) : base(name, roll) { } - public GeneralSpell() - { + public GeneralSpell() { } } } \ No newline at end of file diff --git a/dsa/DSALib/Models/Database/Dsa/GroupChar.cs b/dsa/DSALib/Models/Database/Dsa/GroupChar.cs index a0115cd..446bfcc 100644 --- a/dsa/DSALib/Models/Database/Dsa/GroupChar.cs +++ b/dsa/DSALib/Models/Database/Dsa/GroupChar.cs @@ -1,7 +1,5 @@ -namespace DSALib.Models.Database.Dsa -{ - public class GroupChar - { +namespace DSALib.Models.Database.Dsa { + public class GroupChar { public string Name { get; set; } public int Id { get; set; } public int Lp { get; set; } diff --git a/dsa/DSALib/Models/Database/Dsa/Inventory.cs b/dsa/DSALib/Models/Database/Dsa/Inventory.cs index f3f5d7a..5dc5c62 100644 --- a/dsa/DSALib/Models/Database/Dsa/Inventory.cs +++ b/dsa/DSALib/Models/Database/Dsa/Inventory.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -namespace DSALib.Models.Database.Dsa -{ - public class Inventory - { +namespace DSALib.Models.Database.Dsa { + public class Inventory { public int Id { get; set; } public Dictionary Items { get; set; } = new Dictionary(); public Dictionary Food { get; set; } = new Dictionary(); diff --git a/dsa/DSALib/Models/Database/Dsa/Talent.cs b/dsa/DSALib/Models/Database/Dsa/Talent.cs index 214aecc..18f18ff 100644 --- a/dsa/DSALib/Models/Database/Dsa/Talent.cs +++ b/dsa/DSALib/Models/Database/Dsa/Talent.cs @@ -1,20 +1,15 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class Talent : DSALib.Models.Database.DataObject - { - public Talent() - { +namespace DSALib.Models.Database.Dsa { + public class Talent : DataObject { + public Talent() { } - public Talent(string name) - { + public Talent(string name) { 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('/'); } diff --git a/dsa/DSALib/Models/Database/Dsa/Weapon.cs b/dsa/DSALib/Models/Database/Dsa/Weapon.cs index 308c6c5..7f9b36e 100644 --- a/dsa/DSALib/Models/Database/Dsa/Weapon.cs +++ b/dsa/DSALib/Models/Database/Dsa/Weapon.cs @@ -1,15 +1,11 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class Weapon - { - public Weapon() - { +namespace DSALib.Models.Database.Dsa { + public class Weapon { + public Weapon() { } - public Weapon(string name, string damage, int weight, string weaponTalent, string price) - { + 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; @@ -24,11 +20,9 @@ namespace DSALib.Models.Database.Dsa public string Price { get; set; } } - public class MeleeWeapon : Weapon - { + public class MeleeWeapon : Weapon { public MeleeWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, - damage, weight, weaponTalent, price) - { + damage, weight, weaponTalent, price) { } public string TpKK { get; set; } @@ -36,11 +30,9 @@ namespace DSALib.Models.Database.Dsa public string MW { get; set; } } - public class RangedWeapon : Weapon - { + public class RangedWeapon : Weapon { public RangedWeapon(string name, string damage, int weight, string weaponTalent, string price) : base(name, - damage, weight, weaponTalent, price) - { + damage, weight, weaponTalent, price) { } public int AtMod { get; set; } diff --git a/dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs b/dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs index 2ab921b..2deecce 100644 --- a/dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs +++ b/dsa/DSALib/Models/Database/Dsa/WeaponTalent.cs @@ -1,11 +1,8 @@ using System; -namespace DSALib.Models.Database.Dsa -{ - public class WeaponTalent - { - public WeaponTalent(string name, int at, int pa) - { +namespace DSALib.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; diff --git a/dsa/DSALib/Models/Database/Groups/DSAGroup.cs b/dsa/DSALib/Models/Database/Groups/DSAGroup.cs index adbd0ac..574d6a5 100644 --- a/dsa/DSALib/Models/Database/Groups/DSAGroup.cs +++ b/dsa/DSALib/Models/Database/Groups/DSAGroup.cs @@ -1,10 +1,8 @@ using System.Collections.Generic; using DSALib.Models.Database.Dsa; -namespace DSALib.Models.Database.Groups -{ - public class DsaGroup : Group - { +namespace DSALib.Models.Database.Groups { + public class DsaGroup : Group { public List Chars { get; set; } = new List(); } } \ No newline at end of file diff --git a/dsa/DSALib/Models/Database/Groups/Group.cs b/dsa/DSALib/Models/Database/Groups/Group.cs index 096f2be..eaf10c5 100644 --- a/dsa/DSALib/Models/Database/Groups/Group.cs +++ b/dsa/DSALib/Models/Database/Groups/Group.cs @@ -1,7 +1,5 @@ -namespace DSALib.Models.Database.Groups -{ - public class Group - { +namespace DSALib.Models.Database.Groups { + public class Group { public string Name { get; set; } public string Password { get; set; } public int Id { get; set; } diff --git a/dsa/DSALib/Models/Database/IDataObject.cs b/dsa/DSALib/Models/Database/IDataObject.cs index bdc88b7..41a0882 100644 --- a/dsa/DSALib/Models/Database/IDataObject.cs +++ b/dsa/DSALib/Models/Database/IDataObject.cs @@ -1,7 +1,5 @@ -namespace DSALib.Models.Database -{ - public interface IDataObject - { +namespace DSALib.Models.Database { + public interface IDataObject { string Name { get; set; } } } \ No newline at end of file diff --git a/dsa/DSALib/Models/Dsa/CritterAttack.cs b/dsa/DSALib/Models/Dsa/CritterAttack.cs index 8cd8b09..bad3bda 100644 --- a/dsa/DSALib/Models/Dsa/CritterAttack.cs +++ b/dsa/DSALib/Models/Dsa/CritterAttack.cs @@ -1,9 +1,8 @@ -namespace DSALib.Models.Dsa -{ - public class CritterAttack : Database.DataObject - { - public CritterAttack(string name, int at, string tp, string comment = "") - { +using DSALib.Models.Database; + +namespace DSALib.Models.Dsa { + public class CritterAttack : DataObject { + public CritterAttack(string name, int at, string tp, string comment = "") { Name = name; At = at; Tp = tp; diff --git a/dsa/DSALib/Models/Dsa/KampfTalent.cs b/dsa/DSALib/Models/Dsa/KampfTalent.cs index 51ad255..2c82fbb 100644 --- a/dsa/DSALib/Models/Dsa/KampfTalent.cs +++ b/dsa/DSALib/Models/Dsa/KampfTalent.cs @@ -1,9 +1,8 @@ -namespace DSALib.Models.Dsa -{ - public class KampfTalent : Database.DataObject - { - public KampfTalent(string name, int at, int pa) - { +using DSALib.Models.Database; + +namespace DSALib.Models.Dsa { + public class KampfTalent : DataObject { + public KampfTalent(string name, int at, int pa) { Name = name; At = at; Pa = pa; diff --git a/dsa/DSALib/Models/Dsa/Talent.cs b/dsa/DSALib/Models/Dsa/Talent.cs index 5771a74..74fc844 100644 --- a/dsa/DSALib/Models/Dsa/Talent.cs +++ b/dsa/DSALib/Models/Dsa/Talent.cs @@ -1,9 +1,9 @@ -namespace DSALib.Models.Dsa -{ - public class Talent : Database.DataObject // talent objekt +using DSALib.Models.Database; + +namespace DSALib.Models.Dsa { + public class Talent : DataObject // talent objekt { - public Talent(string name, string probe, int value) - { + public Talent(string name, string probe, int value) { Name = name; Probe = probe; Value = value; @@ -21,10 +21,8 @@ return temp; } - public bool IstFernkampftalent() - { - switch (Name) - { + public bool IstFernkampftalent() { + switch (Name) { case "Armbrust": case "Belagerungswaffen": case "Blasrohr": diff --git a/dsa/DSALib/Models/Dsa/Vorteil.cs b/dsa/DSALib/Models/Dsa/Vorteil.cs index e37af20..c07d6f8 100644 --- a/dsa/DSALib/Models/Dsa/Vorteil.cs +++ b/dsa/DSALib/Models/Dsa/Vorteil.cs @@ -1,9 +1,9 @@ -namespace DSALib.Models.Dsa -{ - public class Vorteil : Database.DataObject // talent objekt +using DSALib.Models.Database; + +namespace DSALib.Models.Dsa { + public class Vorteil : DataObject // talent objekt { - public Vorteil(string name, string value = "") - { + public Vorteil(string name, string value = "") { Name = name; Value = value; // this.Choice = choice; diff --git a/dsa/DSALib/Models/Dsa/Zauber.cs b/dsa/DSALib/Models/Dsa/Zauber.cs index e4387bf..b0a8feb 100644 --- a/dsa/DSALib/Models/Dsa/Zauber.cs +++ b/dsa/DSALib/Models/Dsa/Zauber.cs @@ -1,10 +1,7 @@ -namespace DSALib.Models.Dsa -{ - public class Zauber : Talent - { +namespace DSALib.Models.Dsa { + public class Zauber : Talent { public Zauber(string name, string probe, int value, char complexity = 'A', string representation = "Magier") - : base(name, probe, value) - { + : base(name, probe, value) { Complexity = complexity; Representation = Representation; } diff --git a/dsa/DSALib/Models/Network/Command.cs b/dsa/DSALib/Models/Network/Command.cs index 5a97e88..1b54e84 100644 --- a/dsa/DSALib/Models/Network/Command.cs +++ b/dsa/DSALib/Models/Network/Command.cs @@ -1,10 +1,8 @@ using System.Collections.Generic; using System.Linq; -namespace DSALib.Models.Network -{ - public class Command - { +namespace DSALib.Models.Network { + public class Command { public ulong GroupId { get; set; } = 0; public ulong CharId { get; set; } public string Name { get; set; } diff --git a/dsa/DSALib/Models/Network/CommandResponse.cs b/dsa/DSALib/Models/Network/CommandResponse.cs index 0816e4a..02ae99b 100644 --- a/dsa/DSALib/Models/Network/CommandResponse.cs +++ b/dsa/DSALib/Models/Network/CommandResponse.cs @@ -1,11 +1,8 @@ using System; -namespace DSALib.Models.Network -{ - public class CommandResponse - { - public CommandResponse(string message, ResponseType responseType = ResponseType.Broadcast) - { +namespace DSALib.Models.Network { + public class CommandResponse { + public CommandResponse(string message, ResponseType responseType = ResponseType.Broadcast) { this.message = message ?? throw new ArgumentNullException(nameof(message)); ResponseType = responseType; } @@ -13,14 +10,12 @@ namespace DSALib.Models.Network public string message { get; } public ResponseType ResponseType { get; } - public override string ToString() - { + public override string ToString() { return message; } } - public enum ResponseType - { + public enum ResponseType { Broadcast, Caller, Error -- cgit v1.2.3-70-g09d2