/** * Remove a listener. * @param comp The component to be listened on (or null for listening on all components). * @param listener The listener to be removed. */ public IFuture<Void> removeComponentListener(IComponentIdentifier comp, ICMSComponentListener listener) { listeners.removeObject(comp, listener); return IFuture.DONE; }
/** * Internal remove method, which doesn't affect the reverse collection. */ protected void _remove(Object key, Object value) { super.removeObject(key, value); } }
/** * remove a prey food to the world. * @param nfood Thefood. */ public boolean removeFood(Food nfood) { this.world.removeObject(nfood.getLocation(), nfood); return this.food.remove(nfood); }
/** * Remove a obstacle to the world. * @param obstacle The obstacle. */ public boolean removeObstacle(Obstacle obstacle) { this.world.removeObject(obstacle.getLocation(), obstacle); return this.obstacles.remove(obstacle); }
/** * Remove an avatar mapping. * @param componenttype The component type. * @param objecttype The object type to represent the component. */ public void removeAvatarMappings(AvatarMapping mapping) { synchronized(monitor) { this.avatarmappings.removeObject(mapping.getComponentType(), mapping); } }
/** * Remove a special object from the * collection of a defined key. */ public void removeObject(Object key, Object value) { reverse._remove(value, key); super.removeObject(key, value); }
/** * Remove a result listener from a task. */ public void removeTaskListener(Object taskid, IResultListener listener) { synchronized(monitor) { if(tasklisteners!=null) { tasklisteners.removeObject(taskid, listener); if(tasklisteners.isEmpty()) tasklisteners = null; } } }
/** * remove a percept processor. * @param componenttype The component type. * @param proc The percept processor. */ public void removePerceptProcessor(String componenttype, IPerceptProcessor proc) { synchronized(monitor) { List procs = (List)perceptprocessors.get(componenttype); for(int i=0; i<procs.size(); i++) { Object[] tmp = (Object[])procs.get(i); if(proc.equals(tmp[1])) { perceptprocessors.removeObject(componenttype, tmp); break; } } } }
/** * Remove a creature to the world. * @param creature The creature. */ public boolean removeCreature(Creature creature) { // Remove tasks of this creature. int tasks = tasklist.size(); for(Iterator it=tasklist.iterator(); it.hasNext(); ) { TaskInfo task = (TaskInfo) it.next(); Object[] params = (Object[])task.getAction(); if(creature.equals(params[1])) { // System.out.println("Removed: "+task); it.remove(); } } this.pcs.firePropertyChange("taskSize", tasks, tasklist.size()); if(this.world.containsKey(creature.getLocation())) this.world.removeObject(creature.getLocation(), creature); return this.creatures.remove(creature)!=null; }
world.removeObject(me.getLocation(), me); me.setLocation(newloc); world.add(me.getLocation(), me);
/** * Destroys an object in this space. * @param objectId the object's ID */ public void destroySpaceObject(Object id) { try { synchronized(monitor) { // remove the object from grid IVector2 pos = (IVector2)getSpaceObject(id).getProperty(Space2D.PROPERTY_POSITION); if(pos!=null) { IVector2 fieldpos = new Vector2Int(pos.getXAsInteger(), pos.getYAsInteger()); objectsygridpos.removeObject(fieldpos, spaceobjects.get(id)); } super.destroySpaceObject(id); } } catch(Exception e) { e.printStackTrace(); } }
/** * Destroys an object in this space. * @param objectId the object's ID */ public void destroySpaceObject(Object id) { try { synchronized(monitor) { // remove the object from grid IVector3 pos = (IVector3)getSpaceObject(id).getProperty(Space3D.PROPERTY_POSITION); if(pos!=null) { IVector3 fieldpos = new Vector3Int(pos.getXAsInteger(), pos.getYAsInteger(), pos.getZAsInteger()); objectsygridpos.removeObject(fieldpos, spaceobjects.get(id)); } super.destroySpaceObject(id); } } catch(Exception e) { e.printStackTrace(); } }
/** * Destroys an object in this space. * @param objectId the object's ID */ public boolean destroyAndVerifySpaceObject(Object id) { boolean ret = false; try { synchronized(monitor) { // remove the object from grid IVector2 pos = (IVector2)getSpaceObject(id).getProperty(Space2D.PROPERTY_POSITION); if(pos!=null) { IVector2 fieldpos = new Vector2Int(pos.getXAsInteger(), pos.getYAsInteger()); objectsygridpos.removeObject(fieldpos, spaceobjects.get(id)); } super.destroySpaceObject(id); ret = true; } } catch(Exception e) { ret = false; } return ret; }
pos_objects.removeObject(pos, garb); ret = true; pcs.firePropertyChange("worldObjects", garb, null);
pos_objects.removeObject(wo.getPosition(), wo); getWorldObject(name).setPosition(newpos); pos_objects.add(wo.getPosition(), wo);
objectsygridpos.removeObject(oldpos, obj);
objectsygridpos.removeObject(oldpos, obj);