export class PriorityContainer {
    maxSize;
    compareFn;
    items = [];
    constructor(maxSize, compareFn) {
        this.maxSize = maxSize;
        this.compareFn = compareFn;
    }
    addItem(item) {
        this.items.push(item);
        this.items.sort(this.compareFn);
        if (this.items.length > this.maxSize) {
            this.items.pop();
        }
    }
    getItems() {
        return this.items;
    }
}
