{"version":3,"file":"CountLimiter.mjs","sources":["../src/CountLimiter.ts"],"sourcesContent":["/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n * @memberof PIXI\n */\nexport class CountLimiter\n{\n    /** The maximum number of items that can be prepared each frame. */\n    public maxItemsPerFrame: number;\n\n    /** The number of items that can be prepared in the current frame. */\n    public itemsLeft: number;\n\n    /**\n     * @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n     */\n    constructor(maxItemsPerFrame: number)\n    {\n        this.maxItemsPerFrame = maxItemsPerFrame;\n        this.itemsLeft = 0;\n    }\n\n    /** Resets any counting properties to start fresh on a new frame. */\n    beginFrame(): void\n    {\n        this.itemsLeft = this.maxItemsPerFrame;\n    }\n\n    /**\n     * Checks to see if another item can be uploaded. This should only be called once per item.\n     * @returns If the item is allowed to be uploaded.\n     */\n    allowedToUpload(): boolean\n    {\n        return this.itemsLeft-- > 0;\n    }\n}\n"],"names":[],"mappings":"AAKO,MAAM,YACb,CAAA;AAAA,EAUI,YAAY,gBACZ,EAAA;AACI,IAAA,IAAA,CAAK,gBAAmB,GAAA,gBAAA,CAAA;AACxB,IAAA,IAAA,CAAK,SAAY,GAAA,CAAA,CAAA;AAAA,GACrB;AAAA,EAGA,UACA,GAAA;AACI,IAAA,IAAA,CAAK,YAAY,IAAK,CAAA,gBAAA,CAAA;AAAA,GAC1B;AAAA,EAMA,eACA,GAAA;AACI,IAAA,OAAO,KAAK,SAAc,EAAA,GAAA,CAAA,CAAA;AAAA,GAC9B;AACJ;;;;"}