Back to project page ssniper-andengine.
The source code is released under:
Apache License
If you think the Android project ssniper-andengine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.cladophora.ssniper; //w w w .j a v a2 s. co m import com.cladophora.ssniper.entity.Enemy; import org.andengine.util.adt.pool.GenericPool; public class EnemyPool extends GenericPool<Enemy> { public static EnemyPool instance; public static EnemyPool sharedEnemyPool() { if (instance == null) { instance = new EnemyPool(); } return instance; } private EnemyPool() { super(); } @Override protected Enemy onAllocatePoolItem() { return new Enemy(); } @Override protected void onHandleObtainItem(Enemy pItem) { pItem.init(); } @Override protected void onHandleRecycleItem(final Enemy enemy) { enemy.clean(); super.onHandleRecycleItem(enemy); } }