示例#1
0
        public void SpawnHumans()
        {
            abstractFactory = FactoryProducer.GetFactory(FactoryType.Human);

            IHuman beggar;
            IHuman farmer;
            IHuman trader;

            beggar = abstractFactory.GetHuman(HumanType.Beggar);
            farmer = abstractFactory.GetHuman(HumanType.Farmer);
            trader = abstractFactory.GetHuman(HumanType.Trader);

            beggar.Speak();
            farmer.Speak();
            trader.Speak();
        }