@Override public Iterator<TickClient> getTickSet(final Tickable T, final int tickID) { final LinkedList<TickClient> subSet = new LinkedList<TickClient>(); if (tickID < 0) subSet.addAll( tickers.subSet( new StdTickClient(T, 0, 0), true, new StdTickClient(T, 0, Integer.MAX_VALUE), true)); else subSet.addAll( tickers.subSet( new StdTickClient(T, 0, tickID), true, new StdTickClient(T, 0, tickID), true)); return subSet.iterator(); }
@Override public boolean tick(Tickable ticking, int tickID) { if (tickID != Tickable.TICKID_MISCELLANEOUS) return super.tick(ticking, tickID); while (killTrigger[0]) { final LinkedList<MOB> killThese = new LinkedList<MOB>(); synchronized (killTrigger) { killThese.addAll(getDeadMOBsFrom(affected)); killTrigger[0] = false; } for (final MOB M : killThese) { CMLib.combat().postDeath(null, M, null); } } return false; }
@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(); }