Beispiel #1
0
 public boolean anyDoorMotorClosing(Hallway h) {
   return doorMotors[h.ordinal()][Side.LEFT.ordinal()].command() == DoorCommand.CLOSE
       || doorMotors[h.ordinal()][Side.RIGHT.ordinal()].command() == DoorCommand.CLOSE;
 }
Beispiel #2
0
 public boolean anyDoorMotorNudging(Hallway h) {
   return doorMotors[h.ordinal()][Side.LEFT.ordinal()].command() == DoorCommand.NUDGE
       || doorMotors[h.ordinal()][Side.RIGHT.ordinal()].command() == DoorCommand.NUDGE;
 }
Beispiel #3
0
 public boolean anyDoorMotorOpening(Hallway h) {
   return doorMotors[h.ordinal()][Side.LEFT.ordinal()].command() == DoorCommand.OPEN
       || doorMotors[h.ordinal()][Side.RIGHT.ordinal()].command() == DoorCommand.OPEN;
 }
Beispiel #4
0
 public boolean allDoorMotorsStopped(Hallway h) {
   return doorMotors[h.ordinal()][Side.LEFT.ordinal()].command() == DoorCommand.STOP
       && doorMotors[h.ordinal()][Side.RIGHT.ordinal()].command() == DoorCommand.STOP;
 }
Beispiel #5
0
 public boolean allDoorsClosed(Hallway h) {
   return (doorCloseds[h.ordinal()][Side.LEFT.ordinal()].isClosed()
       && doorCloseds[h.ordinal()][Side.RIGHT.ordinal()].isClosed());
 }
Beispiel #6
0
 public boolean anyDoorOpen(Hallway h) {
   return !doorCloseds[h.ordinal()][Side.LEFT.ordinal()].isClosed()
       || !doorCloseds[h.ordinal()][Side.RIGHT.ordinal()].isClosed();
 }
Beispiel #7
0
 // door utility methods
 public boolean allDoorsCompletelyOpen(Hallway h) {
   return doorOpeneds[h.ordinal()][Side.LEFT.ordinal()].isOpen()
       && doorOpeneds[h.ordinal()][Side.RIGHT.ordinal()].isOpen();
 }