public void RemoveBeenInContact(Citoyen oldCitoyen)
        {
            if (oldCitoyen == null)
            {
                return;
            }

            graph[cin].Remove(oldCitoyen);
        }
        protected Citoyen(Citoyen c)
        {
            foreach (var cit in c.cotoye)
            {
                cit._isSuspect = true;
            }

            _cin          = c.cin;
            codeCouleur   = c.codeCouleur;
            estVaccine    = c.estVaccine;
            enQuarantaine = c.enQuarantaine;
        }
        public void AddCotoye(Citoyen newCitoyen)
        {
            if (newCitoyen == null)
            {
                return;
            }

            if (cotoye != null)
            {
                cotoye.Add(newCitoyen);
                if (newCitoyen.cotoye != null)
                {
                    newCitoyen.cotoye.Add(this);
                }
            }
            else
            {
                Console.WriteLine($"Key = {cin} is not found.");
            }
        }
        static void Main(string[] args)
        {
            Citoyen c = new Citoyen("D871624");

            Citoyen c1 = new Citoyen("D77921");
            Citoyen c2 = new Citoyen("890766");

            //c2.AddCotoye(c);
            //c.AddCotoye(c1);

            //Console.WriteLine(c1.isSuspect);
            //Console.WriteLine(c2.isSuspect);

            //Patient p = new Patient(c);

            //Console.WriteLine(c1.isSuspect);
            //Console.WriteLine(c2.isSuspect);


            //foreach (var cit in p.cotoye)
            //{
            //    Console.WriteLine(cit.cin);

            //}

            //p.RemoveBeenInContact(c1);

            //Console.WriteLine("*****************************");

            //foreach (var cit in p.cotoye)
            //{
            //    Console.WriteLine(cit.cin);

            //}

            c.beenTo(new Location("Celio"));

            c.printLocations();
        }
Exemple #5
0
 public Patient(Citoyen c)
     : base(c)
 {
 }