author suo
  class Pool { public static jumpCoinText : string = "jumpCoinText" ; public static jumpCoinTexts : string = "jumpCoinTexts" ; public static jumpCoinTextsFree : string = "jumpCoinTextsFree" ; public static flyCoin : string = "flyCoin" ; public static yiWangDaJin : string = "yiWangDaJin" ; public static boomIMG : string = "boomIMG" ; public static langbo : string = "langbo" ; public static langbo1 : string = "langbo1" ; public static collider : string = "collider" ; public static clickingWaterWave : string = "clickingWaterWave" ; public static by_BurstGray : string = "by_BurstGray" ; public static by_BurstGold : string = "by_BurstGold" ; public static by_BurstMoneyGold_S : string = "by_BurstMoneyGold_S" ; public static by_BurstMoneyGray_S : string = "by_BurstMoneyGray_S" ; public static by_BurstMoneyGold_B : string = "by_BurstMoneyGold_B" ; public static by_BurstMoneyGray_B : string = "by_BurstMoneyGray_B" ; public static ElectricEffLine : string = "ElectricEffLine" ; public static ElectricEffBurst : string = "ElectricEffBurst" ; public static ElectricEffBurst_Big : string = "ElectricEffBurst_Big" ; public static Boom : string = "Boom" ; public static HighOddsDieEff : string = "HighOddsDieEff" ; public static BoomExSelf : string = "BoomExSelf" ; public static GoldPile1 : string = "GoldPile1" ; public static GoldPile2 : string = "GoldPile2" ; public static commonGold : string = "commonGold" ; public static commonGrayGold : string = "commonGrayGold" ; public static commonIMG : string = "commonIMG" ; private private static _poolDic : Object = { } ; private static _signAry : string [ ] = [ ] ; public constructor ( ) { } param sign return public static getPoolBySign ( sign ) { return this . _poolDic [ sign ] || ( this . _poolDic [ sign ] = [ ] ) ; } param sign public static clearBySign ( sign ) { if ( this . _signAry . indexOf ( sign ) != - 1 ) { this . _signAry . remove ( sign ) ; } if ( this . _poolDic [ sign ] ) this . _poolDic [ sign ] . length = 0 ; } param sign param item public static recover ( sign , item ) { this . getPoolBySign ( sign ) . push ( item ) ; } param sign param cls return public static getItemByClass ( sign , cls ) { if ( this . _signAry . indexOf ( sign ) == - 1 ) { this . _signAry . push ( sign ) ; } var pool = this . getPoolBySign ( sign ) ; var rst = pool . length ? pool . pop ( ) : new cls ( ) ; return rst ; } param sign param createFun return public static getItemByCreateFun ( sign , createFun ) { if ( this . _signAry . indexOf ( sign ) == - 1 ) { this . _signAry . push ( sign ) ; } var pool = this . getPoolBySign ( sign ) ; var rst = pool . length ? pool . pop ( ) : createFun . run ( ) ; return rst ; } param sign return public static getItem ( sign ) { var pool = this . getPoolBySign ( sign ) ; var rst = pool . length ? pool . pop ( ) : null ; return rst ; } /**
     * 释放
     */ public static clearAll ( ) { for ( let i = 0 ; i < this . _signAry . length ; i ++ ) { let sign = this . _signAry [ i ] ; let itemAry = this . _poolDic [ sign ] ; for ( let j = 0 ; j < itemAry . length ; j ++ ) { if ( itemAry [ j ] ) { if ( itemAry [ j ] instanceof particle . GravityParticleSystem ) { itemAry [ j ] . stop ( ) ; } itemAry [ j ] = null ; } } itemAry . length = 0 ; } this . _signAry . length = 0 ; } }