package speiger.src.coreengine.assets;

import java.io.Closeable;
import java.io.IOException;

public class MultiAsset implements Closeable
{
	IAsset[] assets;
	
	public MultiAsset(IAsset[] assets)
	{
		this.assets = assets;
	}
	
	@Override
	public void close() throws IOException
	{
		if(assets != null)
		{
			for(int i = 0,m=assets.length;i<m;i++)
			{
				if(assets[i] != null) assets[i].close();
			}
			assets = null;
		}
	}
	
	public int size()
	{
		return assets.length;
	}
	
	public IAsset getAsset(int index)
	{
		return assets[index];
	}
	
}
