From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- DSALib/Characters/Critter.cs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'DSALib/Characters/Critter.cs') diff --git a/DSALib/Characters/Critter.cs b/DSALib/Characters/Critter.cs index 8092101..c511090 100644 --- a/DSALib/Characters/Critter.cs +++ b/DSALib/Characters/Critter.cs @@ -4,9 +4,7 @@ using System.Collections.Generic; namespace DSALib.Characters { using System.IO; - using DiscoBot.DSA_Game.Characters; - using Newtonsoft.Json; public class Critter : Being, ICombatant @@ -33,15 +31,15 @@ namespace DSALib.Characters public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List critterAttacks) { - this.Gw = gw; - this.Gs = gs; - this.Rs = rs; - this.Mr = mr; - this.Ko = ko; - this.Pa = pa; - this.Ini = ini; - this.CritterAttacks = critterAttacks; - this.lastAttack = this.CritterAttacks[new Random().Next(critterAttacks.Count)]; + Gw = gw; + Gs = gs; + Rs = rs; + Mr = mr; + Ko = ko; + Pa = pa; + Ini = ini; + CritterAttacks = critterAttacks; + lastAttack = CritterAttacks[new Random().Next(critterAttacks.Count)]; } public Critter() @@ -52,7 +50,9 @@ namespace DSALib.Characters { try { - return JsonConvert.DeserializeObject(File.ReadAllText(path)); // Deserialize Data and create Session Object + return + JsonConvert.DeserializeObject( + File.ReadAllText(path)); // Deserialize Data and create Session Object } catch (Exception e) { @@ -75,7 +75,9 @@ namespace DSALib.Characters { try { - File.WriteAllText(path + this.Name + ".json", JsonConvert.SerializeObject(this, Formatting.Indented)); // Deserialize Data and create CommandInfo Struct + File.WriteAllText(path + Name + ".json", + JsonConvert.SerializeObject(this, + Formatting.Indented)); // Deserialize Data and create CommandInfo Struct } catch (Exception e) { @@ -83,4 +85,4 @@ namespace DSALib.Characters } } } -} +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf