You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Übungen_LF6_WinFormanwendung
|
|
|
|
|
{
|
|
|
|
|
class PatientenQueue
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private int gesamtAnzahl = 0;
|
|
|
|
|
private Queue<string> Patienten = new Queue<string>();
|
|
|
|
|
private Queue<string> Notfall = new Queue<string>();
|
|
|
|
|
|
|
|
|
|
public void einreihenNormal(string patient)
|
|
|
|
|
{
|
|
|
|
|
Patienten.Enqueue(patient);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void einreihenNotfall(string patient)
|
|
|
|
|
{
|
|
|
|
|
Notfall.Enqueue(patient);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int anzahlPatienten()
|
|
|
|
|
{
|
|
|
|
|
//Initialisieren
|
|
|
|
|
gesamtAnzahl = 0;
|
|
|
|
|
|
|
|
|
|
gesamtAnzahl += Patienten.Count;
|
|
|
|
|
gesamtAnzahl += Notfall.Count;
|
|
|
|
|
|
|
|
|
|
return gesamtAnzahl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string aufrufen()
|
|
|
|
|
{
|
|
|
|
|
string naechsterPatient = "";
|
|
|
|
|
|
|
|
|
|
if (Notfall.Count > 0)
|
|
|
|
|
naechsterPatient = Notfall.Dequeue();
|
|
|
|
|
else if (Patienten.Count > 0)
|
|
|
|
|
naechsterPatient = Patienten.Dequeue();
|
|
|
|
|
else
|
|
|
|
|
naechsterPatient = "Keine Weiteren Patienten";
|
|
|
|
|
|
|
|
|
|
return naechsterPatient;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|