Exemplo n.º 1
0
        // Operations ///
        private void ResetSystem(object sender, EventArgs e)
        {
            // STUDENTS:
            ///// Class contructors are not defined so there will be errors
            ///// This code is correct for the basic version though
            activeTickets        = new ActiveTickets();
            activePrePaidTickets = new ActivePrePaid();
            ticketMachine        = new TicketMachine(activeTickets, activePrePaidTickets);
            ticketValidator      = new TicketValidator(activeTickets, activePrePaidTickets);
            entryBarrier         = new Barrier();
            exitBarrier          = new Barrier();
            fullSign             = new FullSign();
            carPark     = new CarPark(ticketMachine, ticketValidator, fullSign, entryBarrier, exitBarrier);
            entrySensor = new EntrySensor(carPark);
            exitSensor  = new ExitSensor(carPark);

            ticketMachine.AssignCarPark(carPark);
            ticketValidator.AssignCarPark(carPark);

            /////////////////////////////////////////

            btnVehicleArrivesEntrance.Visible = true;
            btnNormalEntrance.Visible         = false;
            btnPrePaidEntrance.Visible        = false;
            btnEmergencyEntrance.Visible      = false;
            btnPrePaidEnters.Visible          = false;
            btnVehicleEnters.Visible          = false;

            btnVehicleArrivesExit.Visible = false;
            btnNormalExit.Visible         = false;
            btnPrePaidExit.Visible        = false;
            btnEmergencyExit.Visible      = false;
            btnVehicleExits.Visible       = false;
            btnPrePaidExits.Visible       = false;

            lblTicketMachine.Text   = "";
            lblTicketValidator.Text = "";
            lstActiveTickets.Items.Clear();
            lstPrePaidTickets.Items.Clear();

            UpdateDisplay();
        }
Exemplo n.º 2
0
 public EntrySensor(CarPark carPark) : base(carPark)
 {
 }
Exemplo n.º 3
0
 public ExitSensor(CarPark carPark) : base(carPark) { }
Exemplo n.º 4
0
 public void AssignCarPark(CarPark carPark)
 {
     this.carPark = carPark;
 }
Exemplo n.º 5
0
 public Sensor(CarPark carPark)
 {
     this.carPark = carPark;
 }