Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            LiftConfig liftConfig = new LiftConfig();

            liftConfig.MaxFloors = 11;
            liftConfig.Floors    = GetFloors();
            liftConfig.Capacity  = 5;


            Lift lift = new Lift(liftConfig);

            lift.Move(0);

            var floorHistory = string.Join("-", lift.GetFloorHistory());

            Console.WriteLine($"The visited floors in order: {floorHistory}");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the Lift class.
 /// </summary>
 /// <param name="liftConfig">The lift configuration.</param>
 public Lift(LiftConfig liftConfig)
 {
     MaxFloors = liftConfig.MaxFloors;
     Capacity  = liftConfig.Capacity;
     Floors    = liftConfig.Floors;
 }