protected virtual Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
        {
            Person person = null;

            switch (personTypeString)
            {
            case "shopkeeper": person = new Shopkeeper(personNameString, personLocation); break;

            case "traveller": person = new Traveller(personNameString, personLocation); break;

            default: break;
            }
            return(person);
        }
Esempio n. 2
0
        protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
        {
            Person person = null;

            switch (personTypeString)
            {
            case "merchant":
                person = new Shopkeeper(personNameString, personLocation);
                break;

            default: person = base.CreatePerson(personTypeString, personNameString, personLocation);
                break;
            }
            return(person);
        }
 protected virtual Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
 {
     Person person = null;
     switch (personTypeString)
     {
         case "shopkeeper":
             person = new Shopkeeper(personNameString, personLocation);
             break;
         case "traveller":
             person = new Traveller(personNameString, personLocation);
             break;
         default:
             break;
     }
     return person;
 }