public IBuilding GetBuildingType(String buildingType) { IBuilding building = null; // Need to instanciate a pointer to keep compiler happy // If we have a definition for the buildingType requested by the client then create an instance // of that type and reference using the IBuilding interface if (BuildingMap.ContainsKey(buildingType)) { building = (IBuilding)BuildingMap[buildingType]; return(building.CreateBuilding()); } else { return(NULL); } }