優先度キューを作成する必要がありますが、それを行う方法が少し失われます。 私はこれら2つのリストを持っています。優先度キューを作成する
//Medic List
ListaMedico.Add(new Medico(01, "Antonio", 555444333, "[email protected]", "Dermatologista"));
ListaMedico.Add(new Medico(02, "Lucas", 555444333, "[email protected]", "Cardiologista"));
ListaMedico.Add(new Medico(03, "Duarte", 555444333, "[email protected]", "Otorrino"));
ListaMedico.Add(new Medico(04, "Marcos", 555444333, "[email protected]", "Clinica Geral"));
ListaMedico.Add(new Medico(05, "Pedro", 555444333, "[email protected]", "Pediatra"));
そして
//Sick People List
ListaUtente.Add(new Utente(100001, "Pedro", 914754123, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100002, "Lucas", 974123214, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100003, "Rodrigo", 941201456, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100004, "Gaspar",, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100005, "Roberto", 974120219, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100006, "Eduardo", 974120219, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100007, "Ismael", 974120219, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100008, "Paulo", 974120219, "[email protected]", GetRandomColor()));
ListaUtente.Add(new Utente(100009, "Ana", 974120219, "[email protected]", GetRandomColor()));
イム私の患者へのランダムな色を割り当てるには、このコードを使用しました。
static ConsoleColor[] colors = { ConsoleColor.Red, ConsoleColor.Green, ConsoleColor.Yellow, ConsoleColor.Magenta }; // Cores disponíveis para usar nas Senhas
static ConsoleColor GetRandomColor()
{
return colors[random.Next(colors.Length)];
}
マゼンタは優先順位が高く、次に赤、黄色、および最終的に緑色であるため、優先キューが必要です。どのように私はこの色の階層を尊重して私の医者にいくつかの患者を割り当てることができますか?
ありがとうございます。これを試してみよう。 – Dany4k
それは動作していない、任意のアイデアなぜですか?私はこれを私のmain()の中に置くか、新しいクラスを作る必要がありますか? – Dany4k
@ Dany4k列挙型を作成します。彼はこれを行うためのコードを投稿しました。 – Iucounu