public void SpawnTownsPeople(TownsPeopleType peopleToSpawn) { //HAVE FACTORY MANUFACTURE THEM!!! TownsPeople mPerson = mFactory.GetTownsPeople(peopleToSpawn); mPerson.Declaration(); }
//Function to create new Enemes public TownsPeople GetTownsPeople(TownsPeopleType type) { switch (type) { case TownsPeopleType.Hero: TownsPeople hero = new Hero(); return(hero); case TownsPeopleType.Jerk: TownsPeople jerk = new Jerk(); return(jerk); case TownsPeopleType.Toast: TownsPeople toast = new Toast(); return(toast); } return(null); }