diff options
Diffstat (limited to 'dsa/DSALib/Characters')
-rw-r--r-- | dsa/DSALib/Characters/Being.cs | 6 | ||||
-rw-r--r-- | dsa/DSALib/Characters/Critter.cs | 36 | ||||
-rw-r--r-- | dsa/DSALib/Characters/Entity.cs | 9 | ||||
-rw-r--r-- | dsa/DSALib/Characters/ICharacter.cs | 6 | ||||
-rw-r--r-- | dsa/DSALib/Characters/ICombatant.cs | 6 |
5 files changed, 21 insertions, 42 deletions
diff --git a/dsa/DSALib/Characters/Being.cs b/dsa/DSALib/Characters/Being.cs index 27879a1..147bc54 100644 --- a/dsa/DSALib/Characters/Being.cs +++ b/dsa/DSALib/Characters/Being.cs @@ -1,7 +1,5 @@ -namespace DSALib.Characters -{ - public class Being : Entity - { +namespace DSALib.Characters { + public class Being : Entity { public int Lebenspunkte_Basis { get; set; } = 30; public int Lebenspunkte_Aktuell { get; set; } = 30; diff --git a/dsa/DSALib/Characters/Critter.cs b/dsa/DSALib/Characters/Critter.cs index dcedccb..e3a39a6 100644 --- a/dsa/DSALib/Characters/Critter.cs +++ b/dsa/DSALib/Characters/Critter.cs @@ -5,14 +5,11 @@ using DiscoBot.DSA_Game.Characters; using DSALib.Models.Dsa; using Newtonsoft.Json; -namespace DSALib.Characters -{ - public class Critter : Being, ICombatant - { +namespace DSALib.Characters { + public class Critter : Being, ICombatant { public CritterAttack lastAttack; - public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List<CritterAttack> critterAttacks) - { + public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List<CritterAttack> critterAttacks) { Gw = gw; Gs = gs; Rs = rs; @@ -24,8 +21,7 @@ namespace DSALib.Characters lastAttack = CritterAttacks[new Random().Next(critterAttacks.Count)]; } - public Critter() - { + public Critter() { } public int Rs { get; set; } @@ -46,41 +42,33 @@ namespace DSALib.Characters public List<CritterAttack> CritterAttacks { get; set; } - public string Angriff(string talent, int erschwernis = 0) - { + public string Angriff(string talent, int erschwernis = 0) { throw new NotImplementedException(); } - public string Parade(string talent, int erschwernis = 0) - { + public string Parade(string talent, int erschwernis = 0) { throw new NotImplementedException(); } - public static Critter Load(string path) - { - try - { + public static Critter Load(string path) { + try { return JsonConvert.DeserializeObject<Critter>( File.ReadAllText(path)); // Deserialize Data and create Session Object } - catch (Exception e) - { + catch (Exception e) { Console.WriteLine($"Laden von Save-File {path} fehlgeschlagen." + e); return null; } } - public void Save(string path = @"..\..\Critters\") - { - try - { + public void Save(string path = @"..\..\Critters\") { + try { File.WriteAllText(path + Name + ".json", JsonConvert.SerializeObject(this, Formatting.Indented)); // Deserialize Data and create CommandInfo Struct } - catch (Exception e) - { + catch (Exception e) { Console.WriteLine($"Speichern von Save-File {path} fehlgeschlagen." + e); } } diff --git a/dsa/DSALib/Characters/Entity.cs b/dsa/DSALib/Characters/Entity.cs index a8a5e81..cd65b27 100644 --- a/dsa/DSALib/Characters/Entity.cs +++ b/dsa/DSALib/Characters/Entity.cs @@ -1,11 +1,8 @@ -namespace DSALib.Characters -{ - public class Entity - { +namespace DSALib.Characters { + public class Entity { public string Name { get; set; } - public override string ToString() - { + public override string ToString() { return Name; } } diff --git a/dsa/DSALib/Characters/ICharacter.cs b/dsa/DSALib/Characters/ICharacter.cs index 256fecd..72a3b30 100644 --- a/dsa/DSALib/Characters/ICharacter.cs +++ b/dsa/DSALib/Characters/ICharacter.cs @@ -1,9 +1,7 @@ using DiscoBot.DSA_Game.Characters; -namespace DSALib.Characters -{ - public interface ICharacter : ICombatant - { +namespace DSALib.Characters { + public interface ICharacter : ICombatant { string TestTalent(string talent, int erschwernis = 0); string TestEigenschaft(string eigenschaft, int erschwernis = 0); diff --git a/dsa/DSALib/Characters/ICombatant.cs b/dsa/DSALib/Characters/ICombatant.cs index a4ce601..ec0b8b5 100644 --- a/dsa/DSALib/Characters/ICombatant.cs +++ b/dsa/DSALib/Characters/ICombatant.cs @@ -1,7 +1,5 @@ -namespace DiscoBot.DSA_Game.Characters -{ - public interface ICombatant - { +namespace DiscoBot.DSA_Game.Characters { + public interface ICombatant { string Name { get; set; } int Lebenspunkte_Basis { get; set; } |