/** * Updates the entity with the accumulated arguments, established by the * individual setter methods for each specific entity class. */ @SuppressWarnings("unchecked") public void update() { update(Collections.EMPTY_MAP); }
private final List< Entity > toBeRemoved = new LinkedList<>(); public void update(GameContainer gc, int delta) { toBeRemoved.clear(); for( Entity entity : entities ) { if( entity.update( gc, delta )) { toBeRemoved.add( entity ); } } entities.removeAll( toBeRemoved ); }
/** * {@inheritDoc} */ @Override public void update() { // If not present in the update keys, add required attribute as long // as one pre-existing update pair exists if (toUpdate.size() > 0 && !toUpdate.containsKey("name")) { setCacheValue("name", "tcpout"); } super.update(); } }
@Override public void update() { // We have to do some munging on the acceleration fields to pass them as JSON // to the server. Map<String, Object> accelerationMap = new HashMap<String, Object>(); for (String key : new String[] {"enabled", "earliest_time", "cron_schedule", "manual_rebuilds"}) { if (toUpdate.containsKey(key)) { accelerationMap.put(key, toUpdate.get(key)); toUpdate.remove(key); } } if (!accelerationMap.isEmpty()) { toUpdate.put("acceleration", gson.toJson(accelerationMap)); } // Now update like we would any other entity. super.update(); } }
/** * {@inheritDoc} */ @Override public void update() { // If not present in the update keys, add required attribute as long // as one pre-existing update pair exists if (toUpdate.size() > 0 && !toUpdate.containsKey("search")) { setCacheValue("search", getSearch()); } super.update(); } }
/** * {@inheritDoc} */ @Override public void update() { // If not present in the update keys, add required attribute as long // as one pre-existing update pair exists if (toUpdate.size() > 0 && !toUpdate.containsKey("search")) { setCacheValue("search", getSearch()); } super.update(); } }
/** * {@inheritDoc} */ @Override public void update(Map<String, Object> args) { // Add required arguments if not already present if (!args.containsKey("name")) { args = Args.create(args).add("name", "tcpout"); } super.update(args); }
/** * {@inheritDoc} */ @Override public void update() { // If not present in the update keys, add required attribute as long // as one pre-existing update pair exists if (toUpdate.size() > 0 && !toUpdate.containsKey("servers")) { setCacheValue("servers", getString("servers")); } super.update(); } }
/** * {@inheritDoc} */ @Override public void update(Map<String, Object> args) { // Add required arguments if not already present if (!args.containsKey("search")) { args = Args.create(args).add("search", getSearch()); } super.update(args); }
/** * {@inheritDoc} */ @Override public void update(Map<String, Object> args) { // Add required arguments if not already present if (!args.containsKey("servers")) { args = Args.create(args).add("servers", getString("servers")); } super.update(args); }
/** * {@inheritDoc} */ @Override public void update(Map<String, Object> args) { // Add required arguments if not already present if (!args.containsKey("search")) { args = Args.create(args).add("search", getSearch()); } super.update(args); }
Array<Entity> entities = new Array<Entity>(); entities.add(...sprite/entity1, sprite/entity2); for(Entity entity : entities){ if(entity.isVisible()){ entity.update(delta); entity.draw(batch); } }