//opretter persontype ud fra hvad der indlæses fra konfigurationsfilen public ITypeOfPerson Create(string type) { if (type == "Normal") { Console.WriteLine(); Console.WriteLine("NORMAL PERSON"); Console.WriteLine(); return(typeOfPerson = new NormalPerson()); } if (type == "Atlet") { Console.WriteLine(); Console.WriteLine("ATLET"); Console.WriteLine(); return(typeOfPerson = new Atlet()); } throw new ArgumentException("Typen kendes ikke"); }
//constructor public PulseZoneDetector(ConcurrentQueue <DataContainer> dataQueue, ITypeOfPerson typeOfPerson, string age) { _dataQueue = dataQueue; _age = age; TypeOfPerson = typeOfPerson; }