예제 #1
0
        public INPC GetNPC(NPCenum type)
        {
            switch (type)
            {
            case NPCenum.Trader:
                INPC trader = new NPCTrader();
                return(trader);

            case NPCenum.Farmer:
                INPC farmer = new NPCFarmer();
                return(farmer);

            case NPCenum.Beggar:
                INPC beggar = new NPCBeggar();
                return(beggar);

            default:
                break;
            }
            return(null);
        }
예제 #2
0
        public void SpawnNPCAndSpeak(NPCenum type)
        {
            INPC npc = factory.GetNPC(type);

            npc.Speak();
        }