export class Selector extends egret.EventDispatcher{ private _selectlist: els.GameObject[]; constructor() { super() this._selectlist = []; } get selectlist() { return this._selectlist; } set selectlist(value: els.GameObject[]) { if (this._selectlist != value) { this._selectlist = value; } } add(value: els.GameObject) { if (!value || !this._selectlist) return; var index: number = this._selectlist.indexOf(value); if (index === -1) this._selectlist.push(value); } remove(value: els.GameObject) { if (!value || !this._selectlist) return; var index: number = this._selectlist.indexOf(value); this._selectlist.splice(index, 1); } removeAll() { this._selectlist.length = 0; } removeAt(index: number) { this._selectlist.splice(index, 1); } }