private void BattleForm_Load(object sender, EventArgs e) { _battleController = BattleFactory.CreateBattle( _playerParty.GetFirstAlivePokemon(), _enemyParty.GetFirstAlivePokemon(), this, _battleLogController); SetAttackButtons(_battleController.PlayerPokemon); this.Show(); RedrawUI(); _battleLogController.SetText($"Wild {_battleController.EnemyPokemon.Name} appears!"); }
private void PreparePartyForm(IPokemonParty <IPokemon> playerPokemonParty) { this.StartPosition = FormStartPosition.Manual; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.PickedPokemon = playerPokemonParty.GetFirstAlivePokemon(); int offset = 0; int index = 0; foreach (IPokemon pokemon in playerPokemonParty.Pokemons) { if (pokemon != null) { PokemonPanel pokemonPanel = new PokemonPanel(pokemon); //pokemonPanel.Dock = DockStyle.Top; pokemonPanel.Location = new Point(0, offset); pokemonPanel.Index = index; this.Controls.Add(pokemonPanel); offset += pokemonPanel.Size.Height; index++; } } }