Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (radioPokemon.Checked)
            {
                myFactory = new PokemonFactory();
            }
            else if (radioWar.Checked)
            {
                myFactory = new WarFactory();
            }
            myArmor  = myFactory.CreateArmor();
            myArms   = myFactory.CreateArms();
            myBoots  = myFactory.CreateBoots();
            myHat    = myFactory.CreateHat();
            myHelmet = myFactory.CreateHelmet();

            listBox1.Items.Add(myArmor.MakeArmor());
            listBox1.Items.Add(myArms.MakeArms());
            listBox1.Items.Add(myBoots.MakeBoots());
            listBox1.Items.Add(myHat.MakeHat());
            listBox1.Items.Add(myHelmet.MakeHelmet());
            listBox1.Items.Add("--------------------");
        }