예제 #1
0
    public void SpawnTownsPeople(TownsPeopleType peopleToSpawn)
    {
        //HAVE FACTORY MANUFACTURE THEM!!!

        TownsPeople mPerson = mFactory.GetTownsPeople(peopleToSpawn);

        mPerson.Declaration();
    }
예제 #2
0
    //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);
    }