private void mergeVisibility( final THashMap<AbstractBuildingStruct, LayerVisibility> transformed, final TShortObjectHashMap<short[]> layerByGroups) { final ArrayList<AbstractBuildingStruct> buildings = new ArrayList<AbstractBuildingStruct>(); this.m_havenWorld.foreachBuildings( new TObjectProcedure<AbstractBuildingStruct>() { @Override public boolean execute(final AbstractBuildingStruct building) { buildings.add(building); return true; } }); for (final AbstractBuildingStruct b1 : buildings) { for (final AbstractBuildingStruct b2 : buildings) { if (b1 == b2) { continue; } final LayerVisibility visibility1 = transformed.get(b1); final LayerVisibility visibility2 = transformed.get(b2); LayerVisibility.merge(visibility1, visibility2, layerByGroups); } } }