mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 09:59:07 -07:00
package_26 alternativa.tanks.game.utils.objectpool
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package alternativa.tanks.game.utils.objectpool
|
||||
{
|
||||
import flash.utils.Dictionary;
|
||||
|
||||
public class ObjectPoolManager
|
||||
{
|
||||
private var var_103:Dictionary = new Dictionary();
|
||||
|
||||
public function ObjectPoolManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function name_110(objectClass:Class) : Object
|
||||
{
|
||||
return this.getPool(objectClass).name_110();
|
||||
}
|
||||
|
||||
private function getPool(objectClass:Class) : ObjectPool
|
||||
{
|
||||
var pool:ObjectPool = this.var_103[objectClass];
|
||||
if(pool == null)
|
||||
{
|
||||
pool = new ObjectPool(objectClass);
|
||||
this.var_103[objectClass] = pool;
|
||||
}
|
||||
return pool;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user