Exemple #1
0
 @Override
 public String getStatus() {
   final TickClient lastTicked = getLastTicked();
   if (!isAwake()) return "Sleeping";
   if ((lastTicked == null) || (lastTicked.getClientObject() == null)) return "Shutdown";
   final Tickable ticker = lastTicked.getClientObject();
   return ticker.ID()
       + ": "
       + ticker.name()
       + ": "
       + ((myEngine != null) ? myEngine.getTickStatusSummary(ticker) : "null");
 }
Exemple #2
0
 @Override
 public Iterator<TickClient> getLocalItems(int itemTypes, Room R) {
   LinkedList<TickClient> localItems = null;
   for (TickClient C : tickers) {
     switch (itemTypes) {
       case 0:
         if (C.getClientObject() instanceof MOB) {
           if (((MOB) C.getClientObject()).getStartRoom() == R) {
             if (localItems == null) localItems = new LinkedList<TickClient>();
             localItems.add(C);
           }
         } else if ((C.getClientObject() instanceof ItemTicker)
             && ((((ItemTicker) C.getClientObject()).properLocation() == R))) {
           if (localItems == null) localItems = new LinkedList<TickClient>();
           localItems.add(C);
         }
         break;
       case 1:
         if ((C.getClientObject() instanceof ItemTicker)
             && ((((ItemTicker) C.getClientObject()).properLocation() == R))) {
           if (localItems == null) localItems = new LinkedList<TickClient>();
           localItems.add(C);
         }
         break;
       case 2:
         if ((C.getClientObject() instanceof MOB)
             && (((MOB) C.getClientObject()).getStartRoom() == R)) {
           if (localItems == null) localItems = new LinkedList<TickClient>();
           localItems.add(C);
         }
         break;
     }
   }
   if (localItems == null) return null;
   return localItems.iterator();
 }