Beispiel #1
0
 @Override
 protected void sendCloseOpenEvent(boolean isOpen) {
   if (isOpen) {
     cageFSM.processEvent(FSMEvent.CageFSMEvent.Open);
   } else {
     cageFSM.processEvent(FSMEvent.CageFSMEvent.Close);
   }
 }
Beispiel #2
0
  @Override
  protected void sendAddDelEvent(int category, boolean isAdd) {
    switch (category) {
      case Constants.categoryJEWEL:
        if (isAdd) {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Add_J_Action);
        } else {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Del_J_Action);
        }
        break;

      case Constants.categoryNPFOOD:
        if (isAdd) {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Add_NPF_Action);
        } else {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Del_NPF_Action);
        }

        break;

      case Constants.categoryPFOOD:
        if (isAdd) {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Add_PF_Action);
        } else {
          cageFSM.processEvent(FSMEvent.CageFSMEvent.Del_PF_Action);
        }

        break;

      default:
        log.severe("Error in Cage::sendAddDelEvent: no recognizable Thing category!!!");
    }
  }