コード例 #1
0
ファイル: StartForm.cs プロジェクト: svCcare/PokemonV2
        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
ファイル: ItemForm.cs プロジェクト: svCcare/PokemonV2
        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;
            }
        }