<commit_before>package org.anddev.andengine.entity.sprite.batch;

import java.util.ArrayList;

import org.anddev.andengine.entity.IEntity;
import org.anddev.andengine.entity.sprite.BaseSprite;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.util.SmartList;

/**
 * @author <NAME>
 * @since 12:10:35 - 15.06.2011
 */
public class SpriteGroup extends SpriteBatch {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	public SpriteGroup(final Texture pTexture, final int pCapacity) {
		super(pTexture, pCapacity);
		/* Make children not be drawn automatically, as we handle the drawing ourself. */
		this.setChildrenVisible(false);
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	/**
	 * Instead use {@link SpriteGroup#attachChild(BaseSprite)}.
	 */
	@Override
	@Deprecated
	public void attachChild(final IEntity pEntity) {
		if(pEntity instanceof BaseSprite) {
			this.assertCapacity();
			this.assertTexture(((BaseSprite)pEntity).getTextureRegion());
			super.attachChild(pEntity);
		} else {
			throw new IllegalArgumentException();
		}
	}

	public void attachChild(final BaseSprite pBaseSprite) {
		this.assertCapacity();
		this.assertTexture(pBaseSprite.getTextureRegion());
		super.attachChild(pBaseSprite);
	}

	public void attachChildren(final ArrayList<? extends BaseSprite> pBaseSprites) {
		final int baseSpriteCount = pBaseSprites.size();<commit_msg>Added proper message to SpriteGroup.attachChild(IEntity).<commit_after>package org.anddev.andengine.entity.sprite.batch;

import java.util.ArrayList;

import org.anddev.andengine.entity.IEntity;
import org.anddev.andengine.entity.sprite.BaseSprite;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.util.SmartList;

/**
 * @author <NAME>
 * @since 12:10:35 - 15.06.2011
 */
public class SpriteGroup extends SpriteBatch {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	public SpriteGroup(final Texture pTexture, final int pCapacity) {
		super(pTexture, pCapacity);
		/* Make children not be drawn automatically, as we handle the drawing ourself. */
		this.setChildrenVisible(false);
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	/**
	 * Instead use {@link SpriteGroup#attachChild(BaseSprite)}.
	 */
	@Override
	@Deprecated
	public void attachChild(final IEntity pEntity) throws IllegalArgumentException {
		if(pEntity instanceof BaseSprite) {
			this.assertCapacity();
			this.assertTexture(((BaseSprite)pEntity).getTextureRegion());
			super.attachChild(pEntity);
		} else {
			throw new IllegalArgumentException("A SpriteGroup can only handle children of type BaseSprite or subclasses of BaseSprite, like Sprite, TiledSprite or AnimatedSprite.");
		}
	}

	public void attachChild(final BaseSprite pBaseSprite) {
		this.assertCapacity();
		this.assertTexture(pBaseSprite.getTextureRegion());
		super.attachChild(pBaseSprite);
	}

	public void attachChildren(final ArrayList<? extends BaseSprite> pBaseSprites) {
		final int baseSpriteCount = pBaseSprites.size();
{'fraction_non_alphanumeric': 0.3600650860065086, 'fraction_numerical': 0.006508600650860065, 'mean_word_length': 6.019575856443719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3138531', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1043, 'n_words': 206}