public virtual void TreatingHeartAttack(IHeartAttack passerby)
 {
     if (this.Heroe != null)
     {
         this.Heroe.TreatingHeartAttack(passerby);
     }
 }
Beispiel #2
0
        protected void CheckPatientStatus(IHeartAttack passerby)
        {
            var isBreathing = passerby.IsBreathing();

            if (!passerby.IsAware())
            {
                this.CallAmbulance();
                this.FindThorax();
                this.PositionHead();

                while (retry() && !isBreathing)
                {
                    this.ChestCompressions();
                    this.Insufflations();

                    if (passerby.ItHasHeartRhythm())
                    {
                        this.UseDefibrillator();
                    }

                    isBreathing = passerby.IsBreathing();
                }

                if (isBreathing)
                {
                    Console.WriteLine("The doctor has helped the patient. He seems fine now :)");
                }
                else
                {
                    Console.WriteLine("Type B: The doctor gave up and the patient died :(");
                }
            }
        }
Beispiel #3
0
        public override void TreatingHeartAttack(IHeartAttack passerby)
        {
            this.Vehicle.GetSate().TurnOn();
            this.Vehicle.TurnOnSiren();
            this.Vehicle.Drive();
            if (this.Vehicle.GetSate().GetType() == typeof(Broken))
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine($"\nOh no! the doctor's vehicle has broken and now he can not help the patient.\n");
                Console.ResetColor();
                return;
            }
            else
            {
                // While the vehicle is not at rest, it slows down so that it can be switched off.
                if (this.Vehicle.GetSate().GetType() != typeof(StandOff) && this.Vehicle.GetSate().GetType() != typeof(TurnedOff))
                {
                    this.Vehicle.GetSate().Brake();
                }

                this.Vehicle.GetSate().TurnOff();
                Console.WriteLine(this.Vehicle.GetSate().ToString());
            }

            this.Tool.Use();
            TreatingFainting();
            this.Rcp.AttendHeartAttack(passerby);
            this.Tool.PutAway();
        }
Beispiel #4
0
        public void AttendHeartAttack(IHeartAttack passerby)
        {
            this.RemoveObstructingAirwayObjects();

            this.CheckPatientStatus(passerby);
        }