diff options
author | TrueDoctor <d-kobert@web.de> | 2018-09-29 23:59:42 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-09-29 23:59:42 +0200 |
commit | 632781d1adf54287ecfe7cbcbc17074e14a769b2 (patch) | |
tree | ed8d27601fa4ccfa5552af9ef104d1467a05d8e8 | |
parent | 33dc613fffad69c1c608e21eac6fcd3f2954ead8 (diff) |
added database methods
-rw-r--r-- | DSACore/DSA_Game/Save/Properties.cs | 2 | ||||
-rw-r--r-- | DSACore/FireBase/Database.cs | 212 | ||||
-rw-r--r-- | DSACore/Hubs/ChatHub.cs | 26 | ||||
-rw-r--r-- | DSACore/Models/Database/Advantage.cs | 19 | ||||
-rw-r--r-- | DSACore/Models/Database/Char.cs | 27 | ||||
-rw-r--r-- | DSACore/Models/Database/CharSpell.cs | 10 | ||||
-rw-r--r-- | DSACore/Models/Database/DatabaseChar.cs | 47 | ||||
-rw-r--r-- | DSACore/Models/Database/Field.cs | 10 | ||||
-rw-r--r-- | DSACore/Models/Database/GeneralSpell.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/Group.cs | 9 | ||||
-rw-r--r-- | DSACore/Models/Database/GroupChar.cs | 14 | ||||
-rw-r--r-- | DSACore/Models/Database/Inventory.cs | 8 | ||||
-rw-r--r-- | DSACore/Models/Database/Roll.cs | 2 | ||||
-rw-r--r-- | DSACore/Models/Database/Talent.cs | 4 | ||||
-rw-r--r-- | DSACore/Models/Database/Weapon.cs | 8 | ||||
-rw-r--r-- | DSACore/Models/Database/WeaponTalent.cs | 19 | ||||
-rw-r--r-- | DSACore/Models/Network/Group.cs | 6 | ||||
-rw-r--r-- | DSACore/Program.cs | 2 | ||||
-rw-r--r-- | DSALib/Characters/Critter.cs | 2 | ||||
-rw-r--r-- | DiscoBot/Auxiliary/Calculator/StringSolver.cs | 16 | ||||
-rw-r--r-- | ZooBOTanica/CritCreate.cs | 10 |
21 files changed, 371 insertions, 84 deletions
diff --git a/DSACore/DSA_Game/Save/Properties.cs b/DSACore/DSA_Game/Save/Properties.cs index caed278..459a9c7 100644 --- a/DSACore/DSA_Game/Save/Properties.cs +++ b/DSACore/DSA_Game/Save/Properties.cs @@ -14,7 +14,7 @@ namespace DSACore.DSA_Game.Save public static class Properties { - private static Dictionary<string, object> objects; + public static Dictionary<string, object> objects; static Properties() { diff --git a/DSACore/FireBase/Database.cs b/DSACore/FireBase/Database.cs index fd8aa4c..de7d540 100644 --- a/DSACore/FireBase/Database.cs +++ b/DSACore/FireBase/Database.cs @@ -3,6 +3,9 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using DSACore.DSA_Game.Characters; +using DSACore.Models.Database; +using DSACore.Models; using Firebase.Database; using Firebase.Database.Query; @@ -11,17 +14,222 @@ namespace DSACore.FireBase { public static class Database { + public static FirebaseClient firebase; + static Database() { var auth = File.ReadAllText(DSACore.DSA_Game.Dsa.rootPath+"Token"); ; // your app secret - var firebaseClient = new FirebaseClient( + firebase = new FirebaseClient( "https://heldenonline-4d828.firebaseio.com/", new FirebaseOptions { AuthTokenAsyncFactory = () => Task.FromResult(auth) }); } + + + public static async Task<int> AddChar(Character file, Models.Network.Group group) + { + DatabaseChar.LoadChar(file, out GroupChar groupChar, out DatabaseChar data); + + var lastChar = await firebase + .Child("Chars") + .OrderBy("id") + .LimitToLast(1) + .OnceSingleAsync<DatabaseChar>(); + int id = groupChar.Id = data.Id = lastChar.Id + 1; + + await firebase + .Child("Groups") + .Child("Char" + id) + .PutAsync(data); + + await firebase + .Child("Chars") + .Child("Char" + id) + .PutAsync(data); + + await firebase + .Child("Inventories") + .Child("Inventory" + id) + .PutAsync(new Inventory()); + + return id + 1; + } + + public static async Task RemoveChar(int id) + { + + await firebase + .Child("Groups") + .Child("Char" + id) + .DeleteAsync(); + + await firebase + .Child("Chars") + .Child("Char" + id) + .DeleteAsync(); + + await firebase + .Child("Inventories") + .Child("Inventory" + id) + .DeleteAsync(); + + } + + public static async Task<DatabaseChar> GetChar(int id) + { + var chr = await firebase + .Child("Chars") + .Child("Char" + id) + .OnceSingleAsync<DatabaseChar>(); + return chr; + } + + public static async Task<Inventory> GetInventory(int id) + { + var inv = await firebase + .Child("Inventories") + .Child("Inventory"+id) + .OnceSingleAsync<Inventory>(); + return inv; + } + + public static async Task SetInventory(int id, Inventory inv) + { + await firebase + .Child("Inventories") + .Child("Inventory" + id) + .PutAsync(inv); + } + + public static async Task AddTalent(Talent tal) + { + await firebase + .Child("Talents") + .Child(tal.Name) + .PutAsync(tal); + } + + public static async Task RemoveTalent(string talent) + { + await firebase + .Child("Talents") + .Child(talent) + .DeleteAsync(); + } + + public static async Task<Talent> GetTalent(string talent) + { + return await firebase + .Child("Talents") + .Child(talent) + .OnceSingleAsync<Talent>(); + } + + public static async Task AddSpell(GeneralSpell tal) + { + await firebase + .Child("Spells") + .Child(tal.Name) + .PutAsync(tal); + } - public static void DoStuff(){} + public static async Task RemoveSpell(string spell) + { + await firebase + .Child("Spells") + .Child(spell) + .DeleteAsync(); + } + + public static async Task<GeneralSpell> GetSpell(string spell) + { + return await firebase + .Child("Spells") + .Child(spell) + .OnceSingleAsync<GeneralSpell>(); + } + + + public static async Task AddWeapon(Weapon wep) + { + await firebase + .Child("Weapons") + .Child(wep.Name) + .PutAsync(wep); + } + + public static async Task RemoveWeapon(string weapon) + { + await firebase + .Child("Weapons") + .Child(weapon) + .DeleteAsync(); + } + + public static async Task< Weapon> GetWeapon(string weapon) + { + return await firebase + .Child("Weapons") + .Child(weapon) + .OnceSingleAsync<Weapon>(); + } + + public static async Task<List<Models.Network.Group>> GetGroups() + { + var groups = await firebase + .Child("Groups") + .OrderBy("id") + .OnceAsync<Group>(); + var ret = new List<Models.Network.Group>(); + + foreach (var firebaseObject in groups) + { + ret.Add(new Models.Network.Group(firebaseObject.Object.Name, firebaseObject.Object.Password)); + } + + return ret; + } + + public static async Task<Group> GetGroup(int id) + { + var group = await firebase + .Child("Groups") + .Child("Group"+id) + .OnceSingleAsync<Group>(); + return group; + } + + public static async void AddGroup(Group group) + { + var lastChar = await firebase + .Child("Groups") + .OrderBy("id") + .LimitToLast(1) + .OnceSingleAsync<DatabaseChar>(); + int id = group.Id = lastChar.Id + 1; + + await firebase + .Child("Groups") + .Child("Group"+id) + .PutAsync(group); + } + + public static async void SetGroup(Group group) + { + await firebase + .Child("Groups") + .Child("Group" + group.Id) + .PutAsync(group); + } + + public static async void DeleteGroup(int id) + { + await firebase + .Child("Groups") + .Child("Group" + id) + .DeleteAsync(); + } } } diff --git a/DSACore/Hubs/ChatHub.cs b/DSACore/Hubs/ChatHub.cs index 6335183..e489b2e 100644 --- a/DSACore/Hubs/ChatHub.cs +++ b/DSACore/Hubs/ChatHub.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using DSACore.FireBase; using DSACore.Models; using DSACore.Models.Network; using Microsoft.AspNetCore.SignalR; @@ -12,7 +13,17 @@ namespace DSACore.Hubs { //private static Dictionary<string, User> UserGroup = new Dictionary<string, User>(); - private static List<Group> DSAGroups = new List<Group>(); + private static List<Group> DSAGroups = new List<Group>(); + + static ChatHub() + { + DSAGroups = Database.GetGroups().Result; + DSAGroups.Add(new Group("TheCrew", "valid")); + DSAGroups.Add(new Group("HalloWelt", "valid")); + DSAGroups.Add(new Group("DieKrassenGamer", "valid")); + DSAGroups.Add(new Group("DSA", "valid")); + DSAGroups.Add(new Group("DieÜberhelden", "valid")); + } public async Task SendMessage(string user, string message) { @@ -20,15 +31,14 @@ namespace DSACore.Hubs var ident = args.First().Replace("!", ""); if(args.Count>0){args.RemoveAt(0);} - string group; try { - group = getGroup(Context.ConnectionId).Name; + string group = getGroup(Context.ConnectionId).Name; await SendToGroup(group, user, Commands.CommandHandler.ExecuteCommand(new Command { CharId = 0, CmdIdentifier = ident, CmdTexts = args, Name = user })); } catch(InvalidOperationException e) { - await Clients.Caller.SendCoreAsync("ReceiveMessage", new[] {"Nutzer ist in keiner Gruppe. Erst joinen!"}); + await Clients.Caller.SendCoreAsync("ReceiveMessage", new object[] {"Nutzer ist in keiner Gruppe. Erst joinen!"}); } } @@ -38,7 +48,7 @@ namespace DSACore.Hubs return Clients.Group(group).SendCoreAsync("ReceiveMessage", new object[] { user, message }); } - private Group getGroup(string id) + private Models.Network.Group getGroup(string id) { return DSAGroups.First(x => x.Users.Exists(y => y.ConnectionId.Equals(id))); } @@ -51,8 +61,10 @@ namespace DSACore.Hubs public async Task AddGroup(string group, string password) { - DSAGroups.Add(new Group{Name = group, Password = password}); - Clients.Caller.SendCoreAsync("ReceiveMessage", new[] {$"group {group} sucessfully added"}); + DSAGroups.Add(new Group(group, password)); + var Dgroup = new DSACore.Models.Database.Group{Name = group, Id = DSAGroups.Count-1}; + Database.CreateGroup(Dgroup); + await Clients.Caller.SendCoreAsync("ReceiveMessage", new[] {$"group {@group} sucessfully added"}); //throw new NotImplementedException("add database call to add groups"); } diff --git a/DSACore/Models/Database/Advantage.cs b/DSACore/Models/Database/Advantage.cs new file mode 100644 index 0000000..67965fc --- /dev/null +++ b/DSACore/Models/Database/Advantage.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace DSACore.Models.Database +{ + public class Advantage + { + public Advantage(string name, string value = "") + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Value = value ?? throw new ArgumentNullException(nameof(value)); + } + + public string Name { get; set; } + public string Value { get; set; } + } +} diff --git a/DSACore/Models/Database/Char.cs b/DSACore/Models/Database/Char.cs deleted file mode 100644 index 04c16f0..0000000 --- a/DSACore/Models/Database/Char.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace DSACore.Models.Database -{ - public class Char - { - private int Id { get; set; } - - private string Name { get; set; } - - private string Rasse { get; set; } - - private List<Field> Skills { get; set; } = new List<Field>(); - - private List<Field> Talents { get; set; } = new List<Field>(); - - private List<Field> Advantages { get; set; } = new List<Field>(); - - private List<CharSpell> Spells { get; set; } = new List<CharSpell>(); - - private List<WeaponTalent> WeaponTalents { get; set; } = new List<WeaponTalent>(); - - } -} diff --git a/DSACore/Models/Database/CharSpell.cs b/DSACore/Models/Database/CharSpell.cs index cdb5447..670488c 100644 --- a/DSACore/Models/Database/CharSpell.cs +++ b/DSACore/Models/Database/CharSpell.cs @@ -7,7 +7,13 @@ namespace DSACore.Models.Database { public class CharSpell { - private string representation { get; set; } - private int value { get; set; } + public CharSpell(string representation, int value) + { + this.representation = representation ?? throw new ArgumentNullException(nameof(representation)); + this.value = value; + } + + public string representation { get; set; } + public int value { get; set; } } } diff --git a/DSACore/Models/Database/DatabaseChar.cs b/DSACore/Models/Database/DatabaseChar.cs new file mode 100644 index 0000000..03383b8 --- /dev/null +++ b/DSACore/Models/Database/DatabaseChar.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using DSALib; + +namespace DSACore.Models.Database +{ + public class DatabaseChar + { + public int Id { get; set; } + + public string Name { get; set; } + + public string Rasse { get; set; } + + public List<Field> Skills { get; set; } = new List<Field>(); + + public List<Field> Talents { get; set; } = new List<Field>(); + + public List<Advantage> Advantages { get; set; } = new List<Advantage>(); + + public List<CharSpell> Spells { get; set; } = new List<CharSpell>(); + + public List<WeaponTalent> WeaponTalents { get; set; } = new List<WeaponTalent>(); + + + public static void LoadChar(DSA_Game.Characters.Character file, out GroupChar group, out DatabaseChar data) + { + group = new GroupChar(); + data = new DatabaseChar(); + + group.Name = file.Name.Split(' ').First(); + group.Weapon = new Weapon(); + group.Lp = group.LpMax = file.Lebenspunkte_Basis; + group.As = group.AsMax = file.Astralpunkte_Basis; + group.Weapon = new Weapon(); + + data.Name = file.Name; + data.Advantages = file.Vorteile.Select(x => new Advantage(x.Name, x.Value)).ToList(); + data.Skills = file.Eigenschaften.Select(x => new Field(x.Key, x.Value)).ToList(); + data.Spells = file.Zauber.Select(x => new CharSpell(x.Representation, x.Value)).ToList(); + data.Talents = file.Talente.Select(x => new Field(x.Name, x.Value)).ToList(); + data.WeaponTalents = file.Kampftalente.Select(x => new WeaponTalent(x.Name, x.At, x.Pa)).ToList(); + } + } +} diff --git a/DSACore/Models/Database/Field.cs b/DSACore/Models/Database/Field.cs index fe1ea1f..b14d9da 100644 --- a/DSACore/Models/Database/Field.cs +++ b/DSACore/Models/Database/Field.cs @@ -7,7 +7,13 @@ namespace DSACore.Models.Database { public class Field { - private string Name { get; set; } - private int value { get; set; } + public Field(string name, int value = 0) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + this.Value = value; + } + + public string Name { get; set; } + public int Value { get; set; } } } diff --git a/DSACore/Models/Database/GeneralSpell.cs b/DSACore/Models/Database/GeneralSpell.cs index 4f2a8cb..807a09b 100644 --- a/DSACore/Models/Database/GeneralSpell.cs +++ b/DSACore/Models/Database/GeneralSpell.cs @@ -7,6 +7,6 @@ namespace DSACore.Models.Database { public class GeneralSpell : Talent { - private string Comlexity = "A"; + public string Comlexity = "A"; } } diff --git a/DSACore/Models/Database/Group.cs b/DSACore/Models/Database/Group.cs index fb17909..0273aed 100644 --- a/DSACore/Models/Database/Group.cs +++ b/DSACore/Models/Database/Group.cs @@ -7,9 +7,10 @@ namespace DSACore.Models.Database { public class Group { - private string Name { get; set; } - private string Discord { get; set; } - private int Id { get; set; } - private List<GroupChar> Chars { get; set; }= new List<GroupChar>(); + public string Name { get; set; } + public string Discord { get; set; } + public string Password { get; set; } + public int Id { get; set; } + public List<GroupChar> Chars { get; set; }= new List<GroupChar>(); } } diff --git a/DSACore/Models/Database/GroupChar.cs b/DSACore/Models/Database/GroupChar.cs index 66e203b..1dfc4ea 100644 --- a/DSACore/Models/Database/GroupChar.cs +++ b/DSACore/Models/Database/GroupChar.cs @@ -7,12 +7,12 @@ namespace DSACore.Models.Database { public class GroupChar { - private string Name { get; set; } - private int Id { get; set; } - private int Lp { get; set; } - private int LpMax { get; set; } - private int As { get; set; } - private int AsMax { get; set; } - private Weapon Weapon { get; set; } + public string Name { get; set; } + public int Id { get; set; } + public int Lp { get; set; } + public int LpMax { get; set; } + public int As { get; set; } + public int AsMax { get; set; } + public Weapon Weapon { get; set; } } } diff --git a/DSACore/Models/Database/Inventory.cs b/DSACore/Models/Database/Inventory.cs index 8e525c6..e6b47ec 100644 --- a/DSACore/Models/Database/Inventory.cs +++ b/DSACore/Models/Database/Inventory.cs @@ -7,9 +7,9 @@ namespace DSACore.Models.Database { public class Inventory { - private int Id { get; set; } - private List<string> Items { get; set; } = new List<string>(); - private List<string> Food { get; set; } = new List<string>(); - private List<Weapon> Weapons { get; set; } = new List<Weapon>(); + public int Id { get; set; } + public Dictionary<string, bool> Items { get; set; } = new Dictionary<string, bool>(); + public Dictionary<string, bool> Food { get; set; } = new Dictionary<string, bool>(); + public List<Weapon> Weapons { get; set; } = new List<Weapon>(); } } diff --git a/DSACore/Models/Database/Roll.cs b/DSACore/Models/Database/Roll.cs index c931e70..547fde4 100644 --- a/DSACore/Models/Database/Roll.cs +++ b/DSACore/Models/Database/Roll.cs @@ -7,6 +7,6 @@ namespace DSACore.Models.Database { public class Roll { - private string[] Skills { get; set; } = new string[3]; + public string[] Skills { get; set; } = new string[3]; } } diff --git a/DSACore/Models/Database/Talent.cs b/DSACore/Models/Database/Talent.cs index d7bfaae..6bd8cba 100644 --- a/DSACore/Models/Database/Talent.cs +++ b/DSACore/Models/Database/Talent.cs @@ -7,8 +7,8 @@ namespace DSACore.Models.Database { public class Talent { - private string Name { get; set; } + public string Name { get; set; } - private Roll Roll { get; set; } = new Roll(); + public Roll Roll { get; set; } = new Roll(); } } diff --git a/DSACore/Models/Database/Weapon.cs b/DSACore/Models/Database/Weapon.cs index b72ec20..9c75b30 100644 --- a/DSACore/Models/Database/Weapon.cs +++ b/DSACore/Models/Database/Weapon.cs @@ -7,9 +7,9 @@ namespace DSACore.Models.Database { public class Weapon { - private string Name { get; set; } - private string Damage { get; set; } - private string WeaponTalent { get; set; } - private string Modifier { get; set; } + public string Name { get; set; } + public string Damage { get; set; } + public string WeaponTalent { get; set; } + public string Modifier { get; set; } } } diff --git a/DSACore/Models/Database/WeaponTalent.cs b/DSACore/Models/Database/WeaponTalent.cs index 37d7150..4b98d24 100644 --- a/DSACore/Models/Database/WeaponTalent.cs +++ b/DSACore/Models/Database/WeaponTalent.cs @@ -1,9 +1,18 @@ -namespace DSACore.Models.Database +using System; + +namespace DSACore.Models.Database { - class WeaponTalent + public class WeaponTalent { - private string Name { get; set; } - private int At { get; set; } - private int Pa { get; set; } + public WeaponTalent(string name, int at, int pa) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + At = at; + Pa = pa; + } + + public string Name { get; set; } + public int At { get; set; } + public int Pa { get; set; } } }
\ No newline at end of file diff --git a/DSACore/Models/Network/Group.cs b/DSACore/Models/Network/Group.cs index 2b59931..80a5a81 100644 --- a/DSACore/Models/Network/Group.cs +++ b/DSACore/Models/Network/Group.cs @@ -7,6 +7,12 @@ namespace DSACore.Models.Network { public class Group { + public Group(string name, string password) + { + Name = name; + Password = password; + } + public string Name { get; set; } public string Password { get; set; } public List<User> Users { get; set; } = new List<User>(); diff --git a/DSACore/Program.cs b/DSACore/Program.cs index ec16fd3..cd85710 100644 --- a/DSACore/Program.cs +++ b/DSACore/Program.cs @@ -15,7 +15,7 @@ namespace DSACore { public static void Main(string[] args) { - Database.DoStuff(); + Database.GetGroup(0); DSA_Game.Dsa.Startup(); CreateWebHostBuilder(args).Build().Run(); } diff --git a/DSALib/Characters/Critter.cs b/DSALib/Characters/Critter.cs index c6776ed..8092101 100644 --- a/DSALib/Characters/Critter.cs +++ b/DSALib/Characters/Critter.cs @@ -29,7 +29,7 @@ namespace DSALib.Characters public List<CritterAttack> CritterAttacks { get; set; } - private CritterAttack lastAttack; + public CritterAttack lastAttack; public Critter(int gw, int gs, int rs, int mr, int ko, int pa, string ini, List<CritterAttack> critterAttacks) { diff --git a/DiscoBot/Auxiliary/Calculator/StringSolver.cs b/DiscoBot/Auxiliary/Calculator/StringSolver.cs index 30c2134..6e5b3a9 100644 --- a/DiscoBot/Auxiliary/Calculator/StringSolver.cs +++ b/DiscoBot/Auxiliary/Calculator/StringSolver.cs @@ -9,8 +9,8 @@ /// </summary> public class StringSolver : ISolvable { - private readonly string input; - private readonly List<object> arguments = new List<object>(); + public readonly string input; + public readonly List<object> arguments = new List<object>(); public StringSolver(string input) { @@ -37,7 +37,7 @@ return ((ISolvable)this.arguments.First()).Solve(); } - private static string GetInner(ref string input) // extract the inner bracket an remove the section from the input string + public static string GetInner(ref string input) // extract the inner bracket an remove the section from the input string { int depth = 0; for (var index = 1; index < input.Length; index++) @@ -67,7 +67,7 @@ return string.Empty; } - private static Ops GetOps(char c) + public static Ops GetOps(char c) { switch (c) { @@ -85,7 +85,7 @@ } } - private static string ExpandParentheses(string input) // insert * between Parentheses and digits + public static string ExpandParentheses(string input) // insert * between Parentheses and digits { for (int i = 0; i < input.Length - 1; i++) { @@ -106,7 +106,7 @@ return input; } - private void AtomizeOperations(string workInput) + public void AtomizeOperations(string workInput) { for (var index = 0; index < workInput.Length; index++) { @@ -146,7 +146,7 @@ } } - private void NestOperations() + public void NestOperations() { foreach (Ops currentOp in Enum.GetValues(typeof(Ops))) { @@ -180,7 +180,7 @@ } } - private void HandleSpecialFormatting(ref int index, Ops op) + public void HandleSpecialFormatting(ref int index, Ops op) { var arg1 = this.arguments[index - 1]; if (arg1.GetType() == typeof(Ops)) diff --git a/ZooBOTanica/CritCreate.cs b/ZooBOTanica/CritCreate.cs index 08a6ff0..08f527d 100644 --- a/ZooBOTanica/CritCreate.cs +++ b/ZooBOTanica/CritCreate.cs @@ -15,7 +15,7 @@ namespace ZooBOTanica public partial class CritCreateForm : Form { - private DSALib.Characters.Critter critter; + public DSALib.Characters.Critter critter; public CritCreateForm() { @@ -23,7 +23,7 @@ namespace ZooBOTanica this.AllowDrop = true; } - private new void Load(string path) + public new void Load(string path) { this.critter = Critter.Load(path); @@ -48,12 +48,12 @@ namespace ZooBOTanica } } - private void CritCreateForm_DragDrop(object sender, DragEventArgs e) + public void CritCreateForm_DragDrop(object sender, DragEventArgs e) { this.Load(e.Data.GetData(DataFormats.Text).ToString()); } - private void LoadButton_Click(object sender, EventArgs e) + public void LoadButton_Click(object sender, EventArgs e) { var dig = new OpenFileDialog(); dig.CheckFileExists = true; @@ -67,7 +67,7 @@ namespace ZooBOTanica } } - private void SaveButton_Click(object sender, EventArgs e) + public void SaveButton_Click(object sender, EventArgs e) { this.critter = new Critter(); this.critter.Astralpunkte_Basis = (int)this.AeEdit.Value; |