示例#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();
 }