/** * Checks if the entity belongs to any group. * * @param e the entity to check * @return true. if it is in any group, false if none */ public boolean isInAnyGroup(Entity e) { return getGroups(e).size() > 0; }
/** * Checks if the entity belongs to any group. * * @param e the entity to check * @return true. if it is in any group, false if none */ public boolean isInAnyGroup(Entity e) { return getGroups(e).size() > 0; }
@Override public boolean inScope(String player, Entity e) { ImmutableBag<Entity> entitiesOfPlayer = playerManager.getEntitiesOfPlayer(player); for (int i = 0, s = entitiesOfPlayer.size(); i < s; i++) { } return false; } }
private void writeGroups(Json json, Entity e) { if (groupManager == null) return; ImmutableBag<String> groups = groupManager.getGroups(e); if (groups.size() == 0) return; json.writeArrayStart("groups"); for (String group : groups) { json.writeValue(group); } json.writeArrayEnd(); }
private void writeGroups(Json json, Entity e) { if (groupManager == null) return; ImmutableBag<String> groups = groupManager.getGroups(e); if (groups.size() == 0) return; json.writeArrayStart("groups"); for (String group : groups) { json.writeValue(group); } json.writeArrayEnd(); }
private void writeGroups(Json json, Entity e) { if (groupManager == null) return; ImmutableBag<String> groups = groupManager.getGroups(e); if (groups.size() == 0) return; json.writeArrayStart("groups"); for (String group : groups) { json.writeValue(group); } json.writeArrayEnd(); }
public boolean isEnabled(BaseSystem system) { Class<? extends BaseSystem> target = system.getClass(); ImmutableBag<BaseSystem> systems = world.getSystems(); for (int i = 0; i < systems.size(); i++) { if (target == systems.get(i).getClass()) return !disabled.get(i); } throw new RuntimeException("huh?"); }
public boolean isEnabled(BaseSystem system) { Class<? extends BaseSystem> target = system.getClass(); ImmutableBag<BaseSystem> systems = world.getSystems(); for (int i = 0; i < systems.size(); i++) { if (target == systems.get(i).getClass()) return !disabled.get(i); } throw new RuntimeException("huh?"); }
/** * Removes from this Bag all of its elements that are contained in the * specified Bag. * * @param bag * Bag containing elements to be removed from this Bag * * @return {@code true} if this Bag changed as a result of the call */ public boolean removeAll(ImmutableBag<E> bag) { boolean modified = false; for (int i = 0, s = bag.size(); s > i; i++) { E e1 = bag.get(i); for (int j = 0; j < size; j++) { E e2 = data[j]; if (e1.equals(e2)) { remove(j); j--; modified = true; break; } } } return modified; }
/** * Removes from this Bag all of its elements that are contained in the * specified Bag. * * @param bag * Bag containing elements to be removed from this Bag * * @return {@code true} if this Bag changed as a result of the call */ public boolean removeAll(ImmutableBag<E> bag) { boolean modified = false; for (int i = 0, s = bag.size(); s > i; i++) { E e1 = bag.get(i); for (int j = 0; j < size; j++) { E e2 = data[j]; if (e1.equals(e2)) { remove(j); j--; modified = true; break; } } } return modified; }
/** * Removes from this Bag all of its elements that are contained in the * specified Bag. * * @param bag * Bag containing elements to be removed from this Bag * * @return {@code true} if this Bag changed as a result of the call */ public boolean removeAll(ImmutableBag<E> bag) { boolean modified = false; for (int i = 0, s = bag.size(); s > i; i++) { E e1 = bag.get(i); for (int j = 0; j < size; j++) { E e2 = data[j]; if (e1.equals(e2)) { remove(j); j--; modified = true; break; } } } return modified; }