예제 #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (_pokemonList.Any())
            {
                var playerParty = PokemonPartyFactory.CreatePokemonParty(_pokemonList, true);
                var enemyParty  = PokemonPartyFactory.CreatePokemonParty(_enemyPokemonList, false);

                BattleForm battleForm = new BattleForm(playerParty, enemyParty);
                battleForm.Show();
                Hide();
            }
            else
            {
                MessageBox.Show("Team not selected");
            }
        }
예제 #2
0
        public ItemForm(IEquipment equipment, IPokemonParty <IPokemon> pokemonParty, BattleForm battleForm)
        {
            InitializeComponent();
            //if (isShopForm)
            //    this.parent = parent as AfterWinForm;
            //else
            //    this.parent = parent as BattleForm;
            _equipment    = equipment;
            _battleForm   = battleForm;
            _pokemonParty = pokemonParty;
            this.Text     = "Items";
            //this.Text = isShopForm ? "Shop" : "Items";
            int offset = 0;

            foreach (KeyValuePair <IEquipmentItem, int> item in equipment.EquipmentList)
            {
                // quantity = item.Value ;
                ItemPanel itemPanel = new ItemPanel(item.Key, item.Value, this);
                itemPanel.Location = new Point(0, offset);
                this.Controls.Add(itemPanel);
                offset += itemPanel.Size.Height;
            }
        }