class PukerContainer extends egret . DisplayObjectContainer { /**
     * 标准扑克容器，控制自己的牌
     * 这个容器支持点击选牌操作，可以用来做斗地主、跑得快等
     * player 场景，当场景加载该容器时，传入该场景，该场景必须实现pukerClick（evt:egret.TouchEvent）方法，用来处理点击扑克后执行的处理流程
     * arrays 扑克id的数组
     * x 扑克的x坐标
     */ public constructor ( player , arrays ) { super ( ) ; let pc = RES . getRes ( "layout_json" ) . pukerContainer ; this . x = pc . x ; this . y = pc . y ; this . width = pc . width ; this . height = pc . height ; this . show ( player , arrays ) ; } private show ( player , arrays ) { let p = RES . getRes ( "layout_json" ) . puker ; let x = ( 20 - arrays . length ) * 0.5 * p . pukerSpace ; for ( var i = 0 ; i < arrays . length ; i ++ ) { let puker = new Puker ( arrays [ i ] , x + i * p . pukerSpace , p . pukerUpMove , p . pukerWidth , p . pukerHeight ) ; puker . touchEnabled = true ; puker . addEventListener ( egret . TouchEvent . TOUCH_TAP , player . pukerClick , player ) ; this . addChild ( puker ) ; } } public removePukerByNames ( name ) { for ( var i = 0 ; i < name . length ; i ++ ) { if ( this . getChildByName ( name [ i ] + "" ) != null ) { this . removeChild ( this . getChildByName ( name [ i ] + "" ) ) ; } } } }