export default class Pool {
    pool;
    constructor() {
        this.pool = {};
    }
    takeOut(name) {
        if (this.pool[name] && this.pool[name].length) {
            return this.pool[name].shift();
        }
        return false;
    }
    recover(name, obj) {
        if (!this.pool[name]) {
            this.pool[name] = [];
        }
        this.pool[name].push(obj);
    }
}