Пример #1
0
        private static void InitializeProgram(int currentParkedFloorValue, out ILift lift)
        {
            FloorConfiguration floorConfig = new FloorConfiguration(currentParkedFloorValue, MINFLOOR, MAXFLOOR);
            IExecutionPlan     plan        = new ExecutionPlan();

            lift = new Lift(floorConfig, plan);
        }
Пример #2
0
 public Elevator(int id, ILift lift, IFloorManager floorManager, int maxFloorcount, int currentFloor)
 {
     this.id            = id;
     this.lift          = lift;
     this.floorManager  = floorManager;
     this.currentFloor  = currentFloor;
     this.maxFloorcount = maxFloorcount;
 }
Пример #3
0
        public LiftController(ILift lift1, ILift lift2, ILift lift3)
        {
            _lift1 = lift1;
            _lift2 = lift2;
            _lift3 = lift3;

            _lifts.Add(_lift1);
            _lifts.Add(_lift2);
            _lifts.Add(_lift3);
        }
Пример #4
0
 private void ChangeLift(ILift lift)
 {
     if (Lift != null)
     {
         DeleteConnections(Lift);
     }
     Lift = lift;
     if (Lift != null)
     {
         SetupConnections(Lift);
     }
     UpdateView();
 }
Пример #5
0
    public static void Lift(ILift node)
    {
        if (node.CanLift() && !Carrying)
        {
            Carrying    = true;
            CarriedNode = node;

            PlayerReticle.Singleton.Visible = false;

            node.ShowAndActivate(false);

            Singleton.PreviewMesh.Visible = true;
            SetPreview(node.GetPreviewMesh(), node.GetPreviewMaterial());
            PositionPreview(node.GetOwner().GlobalTransform.origin);
        }
    }
Пример #6
0
        private static void Run(ILift lift)
        {
            WriteInstructions();

            string input = "default";

            while (!string.IsNullOrWhiteSpace(input))
            {
                input = Console.ReadLine();
                IList <SummonInformation> requests = input.ExtractRequests();

                var executionPlan = lift.ProcessRequests(requests);
                Console.Write($"List of floor visited in order: {executionPlan.ToString()}");
                Console.Write(Environment.NewLine);
            }
        }
Пример #7
0
 protected override void DeleteConnections(ILift lift)
 {
     base.DeleteConnections(lift);
     lift.OnStateChanged -= OnStateChanged;
 }
Пример #8
0
 protected override void SetupConnections(ILift lift)
 {
     base.SetupConnections(lift);
     lift.OnStateChanged += OnStateChanged;
 }
Пример #9
0
 protected override void SetupConnections(ILift lift)
 {
     base.SetupConnections(lift);
     Lift.OnFloorChanged += OnFloorChanged;
 }
Пример #10
0
 protected virtual void DeleteConnections(ILift lift)
 {
 }
Пример #11
0
 protected virtual void SetupConnections(ILift lift)
 {
 }