"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsumerLayersT = exports.ConsumerLayers = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class ConsumerLayers {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsConsumerLayers(bb, obj) {
        return (obj || new ConsumerLayers()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsConsumerLayers(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new ConsumerLayers()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    spatialLayer() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
    }
    temporalLayer() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.readUint8(this.bb_pos + offset) : null;
    }
    static startConsumerLayers(builder) {
        builder.startObject(2);
    }
    static addSpatialLayer(builder, spatialLayer) {
        builder.addFieldInt8(0, spatialLayer, 0);
    }
    static addTemporalLayer(builder, temporalLayer) {
        builder.addFieldInt8(1, temporalLayer, null);
    }
    static endConsumerLayers(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createConsumerLayers(builder, spatialLayer, temporalLayer) {
        ConsumerLayers.startConsumerLayers(builder);
        ConsumerLayers.addSpatialLayer(builder, spatialLayer);
        if (temporalLayer !== null)
            ConsumerLayers.addTemporalLayer(builder, temporalLayer);
        return ConsumerLayers.endConsumerLayers(builder);
    }
    unpack() {
        return new ConsumerLayersT(this.spatialLayer(), this.temporalLayer());
    }
    unpackTo(_o) {
        _o.spatialLayer = this.spatialLayer();
        _o.temporalLayer = this.temporalLayer();
    }
}
exports.ConsumerLayers = ConsumerLayers;
class ConsumerLayersT {
    spatialLayer;
    temporalLayer;
    constructor(spatialLayer = 0, temporalLayer = null) {
        this.spatialLayer = spatialLayer;
        this.temporalLayer = temporalLayer;
    }
    pack(builder) {
        return ConsumerLayers.createConsumerLayers(builder, this.spatialLayer, this.temporalLayer);
    }
}
exports.ConsumerLayersT = ConsumerLayersT;
