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 a 2 s.c o m import com.cladophora.ssniper.entity.Plant; import org.andengine.util.adt.pool.GenericPool; public class PlantPool extends GenericPool<Plant> { public static PlantPool instance; public static PlantPool getSharedInstance() { if (instance == null) { instance = new PlantPool(); } return instance; } private PlantPool() { super(); } @Override protected Plant onAllocatePoolItem() { return new Plant(); } @Override protected void onHandleObtainItem(Plant pItem) { pItem.init(); } @Override protected void onHandleRecycleItem(final Plant plant) { plant.clean(); super.onHandleRecycleItem(plant); } }