示例#1
0
 @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);
   }
 }
示例#2
0
 @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);
   }
 }
示例#3
0
 @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);
   }
 }
示例#4
0
 @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;
   }
 }
示例#5
0
 public void reset(boolean announce) {
   EnvironmentEvent.resetRegionPoint(this);
   resetHotPoint(announce);
 }