@Override public boolean onEnvironmentEvent(EnvironmentEvent event) { NullCheck.notNull(event, "event"); if (event.getType() != EnvironmentEvent.Type.REGULAR) return false; switch (event.getCode()) { case REFRESH: refresh(); return true; case INTRODUCE: return onAnnounce(); case ANNOUNCE_LINE: return onAnnounceLine(); case OK: return onOk(event); case LISTENING_FINISHED: if (event instanceof ListeningFinishedEvent) return onListeningFinishedEvent((ListeningFinishedEvent) event); return false; case MOVE_HOT_POINT: if (event instanceof MoveHotPointEvent) return onMoveHotPoint((MoveHotPointEvent) event); return false; default: return region.onEnvironmentEvent(event, hotPointX, hotPointY); } }
@Override public boolean onEnvironmentEvent(EnvironmentEvent event) { if (event == null) throw new NullPointerException("event may not be null"); switch (event.getCode()) { case REFRESH: refresh(); return true; default: return region.onEnvironmentEvent(event, hotPointX, hotPointY); } }
@Override public boolean onEnvironmentEvent(EnvironmentEvent event) { NullCheck.notNull(event, "event"); if (closing.onEnvironmentEvent(event)) return true; switch (event.getCode()) { case INTRODUCE: luwrain.silence(); luwrain.playSound(Sounds.INTRO_POPUP); luwrain.say(getAreaName()); return true; default: return super.onEnvironmentEvent(event); } }
@Override public boolean onEnvironmentEvent(EnvironmentEvent event) { NullCheck.notNull(event, "event"); if (closing.onEnvironmentEvent(event)) return true; if (region.onEnvironmentEvent(event, hotPointX, hotPointY)) return false; switch (event.getCode()) { case REFRESH: refresh(); return true; case INTRODUCE: luwrain.silence(); luwrain.playSound(Sounds.INTRO_POPUP); luwrain.say(getAreaName()); return true; default: return false; } }