diff --git a/Winda/src/winda/animation/ElevatorMovement.java b/Winda/src/winda/animation/ElevatorMovement.java index 8d62e09..0d8c438 100644 --- a/Winda/src/winda/animation/ElevatorMovement.java +++ b/Winda/src/winda/animation/ElevatorMovement.java @@ -1,6 +1,7 @@ package winda.animation; import java.awt.ScrollPane; +import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import winda.gui.WindaApp; @@ -21,11 +22,14 @@ public class ElevatorMovement extends Thread{ private double speed; private int enter_exit_time; - private Pietro pietro; + private ArrayList pietro; @Override public void run(){ - this.goToFloor(this.pietro); + for(int i=0;i(this.floor_size*(this.floor_count-(number+1)))){ try { this.ea.shift--; this.ea.repaint(); - Thread.sleep((long) (this.jump_time*this.speed)); + this.sleep((long) (this.jump_time*this.speed)); } catch (InterruptedException ex) { Logger.getLogger(ElevatorMovement.class.getName()).log(Level.SEVERE, null, ex); } @@ -62,7 +65,7 @@ public class ElevatorMovement extends Thread{ try { this.ea.shift++; this.ea.repaint(); - Thread.sleep((long) (this.jump_time)); + this.sleep((long) (this.jump_time*this.speed)); } catch (InterruptedException ex) { Logger.getLogger(ElevatorMovement.class.getName()).log(Level.SEVERE, null, ex); } @@ -70,25 +73,34 @@ public class ElevatorMovement extends Thread{ } private void exitElevator(int number){ + if(number<=0) + return; + System.out.println("exitElevator("+number+") elevator_passangers "+this.ea.elevator_passangers); for(int i=0;i