From c4d046858e0822b7c2c540ac2368b2c0e88e7a26 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 17:00:02 +0200 Subject: general refectoring added 42 as dummy Token --- DSACore/Auxiliary/Calculator/Argument.cs | 8 ++++---- DSACore/Auxiliary/Calculator/ISolvable.cs | 2 +- DSACore/Auxiliary/Calculator/Operator.cs | 2 +- DSACore/Auxiliary/Calculator/Ops.cs | 2 +- DSACore/Auxiliary/Calculator/StringSolver.cs | 21 +++++++++------------ DSACore/Auxiliary/CommandInfo.cs | 6 +----- DSACore/Auxiliary/SpellCorrect.cs | 10 +++++----- DSACore/Auxiliary/TalentEnumerableExtension.cs | 4 ++-- DSACore/Auxiliary/WeaponImporter.cs | 10 ++++------ 9 files changed, 28 insertions(+), 37 deletions(-) (limited to 'DSACore/Auxiliary') diff --git a/DSACore/Auxiliary/Calculator/Argument.cs b/DSACore/Auxiliary/Calculator/Argument.cs index 14982aa..5ed9ee3 100644 --- a/DSACore/Auxiliary/Calculator/Argument.cs +++ b/DSACore/Auxiliary/Calculator/Argument.cs @@ -1,9 +1,9 @@ -namespace DSACore.Auxiliary.Calculator -{ - using System; +using System; +namespace DSACore.Auxiliary.Calculator +{ /// - /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. + /// Provides an ISolvable class to save numbers. The class handles Argument checking and conversion from string to int. /// public class Argument : ISolvable { diff --git a/DSACore/Auxiliary/Calculator/ISolvable.cs b/DSACore/Auxiliary/Calculator/ISolvable.cs index 2acbd11..7be4d19 100644 --- a/DSACore/Auxiliary/Calculator/ISolvable.cs +++ b/DSACore/Auxiliary/Calculator/ISolvable.cs @@ -1,7 +1,7 @@ namespace DSACore.Auxiliary.Calculator { /// - /// Object has to be able to return an integer as it's value + /// Object has to be able to return an integer as it's value /// public interface ISolvable { diff --git a/DSACore/Auxiliary/Calculator/Operator.cs b/DSACore/Auxiliary/Calculator/Operator.cs index ed46186..31b2a9b 100644 --- a/DSACore/Auxiliary/Calculator/Operator.cs +++ b/DSACore/Auxiliary/Calculator/Operator.cs @@ -4,7 +4,7 @@ using DSACorev.Auxiliary.Calculator; namespace DSACore.Auxiliary.Calculator { /// - /// The Operator Class represents a binary operator with tow Arguments and an Operation type + /// The Operator Class represents a binary operator with tow Arguments and an Operation type /// public class Operator : ISolvable { diff --git a/DSACore/Auxiliary/Calculator/Ops.cs b/DSACore/Auxiliary/Calculator/Ops.cs index c804257..a5c9a2d 100644 --- a/DSACore/Auxiliary/Calculator/Ops.cs +++ b/DSACore/Auxiliary/Calculator/Ops.cs @@ -1,7 +1,7 @@ namespace DSACorev.Auxiliary.Calculator { /// - /// The Different Operations, witch can be performed in execution-order + /// The Different Operations, witch can be performed in execution-order /// public enum Ops { diff --git a/DSACore/Auxiliary/Calculator/StringSolver.cs b/DSACore/Auxiliary/Calculator/StringSolver.cs index 212f812..b2a7d83 100644 --- a/DSACore/Auxiliary/Calculator/StringSolver.cs +++ b/DSACore/Auxiliary/Calculator/StringSolver.cs @@ -5,28 +5,20 @@ using DSACorev.Auxiliary.Calculator; namespace DSACore.Auxiliary.Calculator { - using System; - using System.Collections.Generic; - using System.Linq; - /// - /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains parentheses + /// The StringSolver divides the calculation string into operations and SubStringSolvers if the string contains + /// parentheses /// public class StringSolver : ISolvable { - private readonly string input; private readonly List arguments = new List(); + private readonly string input; public StringSolver(string input) { this.input = input; } - public override string ToString() - { - return "(0+" + input.Replace(" ", string.Empty).ToLower() + ")"; - } - public int Solve() { var workInput = "0+" + input.Replace(" ", string.Empty).ToLower(); @@ -42,6 +34,11 @@ namespace DSACore.Auxiliary.Calculator return ((ISolvable) arguments.First()).Solve(); } + public override string ToString() + { + return "(0+" + input.Replace(" ", string.Empty).ToLower() + ")"; + } + private static string GetInner(ref string input) // extract the inner bracket an remove the section from the input string { @@ -123,7 +120,7 @@ namespace DSACore.Auxiliary.Calculator switch (c) { case ')': - throw new ArgumentException($"Unmögliche Anordnung von Klammern"); + throw new ArgumentException("Unmögliche Anordnung von Klammern"); case '(': arguments.Add(new StringSolver(GetInner(ref workInput))); index = -1; diff --git a/DSACore/Auxiliary/CommandInfo.cs b/DSACore/Auxiliary/CommandInfo.cs index 9afe6c0..1472587 100644 --- a/DSACore/Auxiliary/CommandInfo.cs +++ b/DSACore/Auxiliary/CommandInfo.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; namespace DSACore.Auxiliary { diff --git a/DSACore/Auxiliary/SpellCorrect.cs b/DSACore/Auxiliary/SpellCorrect.cs index 3ef7bb6..77d1cf3 100644 --- a/DSACore/Auxiliary/SpellCorrect.cs +++ b/DSACore/Auxiliary/SpellCorrect.cs @@ -1,9 +1,9 @@ -namespace DSACore.Auxiliary -{ - using System; - using System.Diagnostics; - using System.Linq; +using System; +using System.Diagnostics; +using System.Linq; +namespace DSACore.Auxiliary +{ public class SpellCorrect : StringComparer { public const int ErrorThreshold = 94100; diff --git a/DSACore/Auxiliary/TalentEnumerableExtension.cs b/DSACore/Auxiliary/TalentEnumerableExtension.cs index 159480d..d83114c 100644 --- a/DSACore/Auxiliary/TalentEnumerableExtension.cs +++ b/DSACore/Auxiliary/TalentEnumerableExtension.cs @@ -1,7 +1,7 @@ -using DSACore.DSA_Game.Characters; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Text; +using DSACore.DSA_Game.Characters; using DSALib; namespace DSACore.Auxiliary diff --git a/DSACore/Auxiliary/WeaponImporter.cs b/DSACore/Auxiliary/WeaponImporter.cs index ab51efb..3375236 100644 --- a/DSACore/Auxiliary/WeaponImporter.cs +++ b/DSACore/Auxiliary/WeaponImporter.cs @@ -1,5 +1,4 @@ -using DSACore.Models.Database; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -7,14 +6,13 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using DSACore.FireBase; using DSACore.Models.Database.DSA; -using Group = System.Text.RegularExpressions.Group; namespace DSACore.Auxiliary { public class WeaponImporter { - private List Weapons = new List(); - private List Range = new List(); + private readonly List Range = new List(); + private readonly List Weapons = new List(); public async Task DownloadWeapons() { @@ -48,7 +46,7 @@ namespace DSACore.Auxiliary { var talent = lines[j]; - var values = await client.GetStringAsync($"http://diarium.eu/dsa4-forge/ajax/calculate/" + i + "/" + + var values = await client.GetStringAsync("http://diarium.eu/dsa4-forge/ajax/calculate/" + i + "/" + ids[j] + "/0/0/0/0/0/10/0/0/0"); values = Regex.Unescape(values.Replace(@"\t", "")); -- cgit v1.2.3-54-g00ecf