예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #5
0
 public boolean allDoorsClosed(Hallway h) {
   return (doorCloseds[h.ordinal()][Side.LEFT.ordinal()].isClosed()
       && doorCloseds[h.ordinal()][Side.RIGHT.ordinal()].isClosed());
 }
예제 #6
0
 public boolean anyDoorOpen(Hallway h) {
   return !doorCloseds[h.ordinal()][Side.LEFT.ordinal()].isClosed()
       || !doorCloseds[h.ordinal()][Side.RIGHT.ordinal()].isClosed();
 }
예제 #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();
 }