import { MBuffers } from "./_Buffers/MBuffers";
export default class Buffer {
    static get_Data(buffer_ID, data_ID) {
        const buffer = this.get(buffer_ID);
        if (buffer == undefined)
            return undefined;
        return buffer.get(data_ID);
    }
    static get(buffer_ID) {
        return MBuffers.get(buffer_ID);
    }
    static set_Data(buffer_ID, data_ID, data) {
        let buffer = this.get(buffer_ID);
        if (buffer != undefined) {
            buffer.set(data_ID, data);
            return;
        }
        this.set(buffer_ID);
        buffer = this.get(buffer_ID);
        buffer.set(data_ID, data);
    }
    static set(buffer_ID) {
        const buffer = new Map();
        MBuffers.set(buffer_ID, buffer);
    }
    static delete_Data(buffer_ID, data_ID) {
        return this.get(buffer_ID).delete(data_ID);
    }
    static delete(buffer_ID) {
        return MBuffers.delete(buffer_ID);
    }
    static clear() {
        MBuffers.clear();
    }
    static get_Data_Array(buffer_ID) {
        const buffer = Buffer.get(buffer_ID);
        if (buffer == undefined)
            return undefined;
        return Array.from(buffer.values());
    }
}
