Ejemplo n.º 1
0
 internal void Move(Floors dest)
 {
     state_d = DoorState.Close;
     if (dest.Equals(current_floor))
     {
         Console.WriteLine("Elevator is already here.");
         Thread.Sleep(1000);
         state_d = DoorState.Open;
     }
     else
     {
         if (current_floor > dest)
         {
             state_d = DoorState.Close;
             Console.WriteLine("Elevator is going down.");
             Thread.Sleep(1000);
         }
         else
         {
             state_d = DoorState.Close;
             Console.WriteLine("Elevator is going up.");
             Thread.Sleep(1000);
         }
         for (int i = 0; i < Math.Abs(current_floor - dest); i++)
         {
             Console.WriteLine("*");
             Thread.Sleep(1000);
         }
         current_floor = dest;
         Console.WriteLine("Elevator came at " + dest);
         Thread.Sleep(1000);
         state_d = DoorState.Open;
     }
 }