public Form1() { InitializeComponent(); ClashLedger.Data.DataAccess database = new ClashLedger.Data.DataAccess("log"); ClashLedger.Model.Player player = new ClashLedger.Model.Player(database); ClashLedger.Model.War war = new ClashLedger.Model.War(); war.Data.Opponent = "TestClan"; ClashLedger.Model.Attack attack = new ClashLedger.Model.Attack(); attack.Data.Opponent = "TestOpponent"; attack.Data.Damage = 50; attack.Data.Gold = 10; attack.Data.Elixar = 20; attack.Data.DarkElixar = 30; war.AddAttack(attack); ClashLedger.Model.Item item = new ClashLedger.Model.Item(); item.Data.Type = (int)ClashLedger.GameData.ItemTypes.Barbarian1; item.Data.Count = 10; attack.AddItem(item); item = new ClashLedger.Model.Item(); item.Data.Type = (int)ClashLedger.GameData.ItemTypes.Archer1; item.Data.Count = 20; attack.AddItem(item); player.AddWar(war); player.Save(); }
private void AddTestData() { ClashLedger.Model.War war = new ClashLedger.Model.War(); war.Data.Opponent = "TestClan"; war.Data.OpponentStars = 24; war.Data.Stars = 25; ClashLedger.Model.Attack attack = new ClashLedger.Model.Attack(); attack.Data.Opponent = "TestOpponent"; attack.Data.Damage = 50; attack.Data.Gold = 10; attack.Data.Elixar = 20; attack.Data.DarkElixar = 30; war.AddAttack(attack); ClashLedger.Model.Troop troop = new ClashLedger.Model.Troop(); troop.Data.Type = 1; troop.Data.Count = 10; attack.AddTroop(troop); troop = new ClashLedger.Model.Troop(); troop.Data.Type = 2; troop.Data.Count = 20; attack.AddTroop(troop); attack = new ClashLedger.Model.Attack(); attack.Data.Opponent = "TestOpponent2"; attack.Data.Damage = 50; attack.Data.Gold = 10; attack.Data.Elixar = 20; attack.Data.DarkElixar = 30; war.AddAttack(attack); troop = new ClashLedger.Model.Troop(); troop.Data.Type = 3; troop.Data.Count = 10; attack.AddTroop(troop); m_Player.AddWar(war); }