Applied-Energistics-2-tiler.../me/cache/helpers/TunnelCollection.java
AlgorithmX2 1a75097e84 Removed Block Definitions for MAC Parts.
Removed Options For MAC and Crafting.
Added Options for Crafting with Quartz Growth and Fluix Reaction.
EU Tunnels Re-Added ( Limit 1 per block. )
Adjusted naming/categorization of various features.
Added "sparkle" effect to seeds that are "growing"
2014-02-23 16:50:53 -06:00

37 lines
724 B
Java

package appeng.me.cache.helpers;
import java.util.Collection;
import java.util.Iterator;
import appeng.parts.p2p.PartP2PTunnel;
import appeng.util.iterators.NullIterator;
public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T>
{
final Class clz;
Collection<T> tunnelsource;
public TunnelCollection(Collection<T> src, Class c) {
tunnelsource = src;
clz = c;
}
@Override
public Iterator<T> iterator()
{
if ( tunnelsource == null )
return new NullIterator();
return new TunnelIterator( tunnelsource, clz );
}
public void setSource(Collection<T> c)
{
tunnelsource = c;
}
public boolean isEmpty()
{
return !iterator().hasNext();
}
}