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