/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Hashtable = require("./../../../unisharp/Hashtable");

const IUnitextGenNumStyle = require("./IUnitextGenNumStyle");

class UnitextGenNumStyleEx extends IUnitextGenNumStyle {
    
    constructor() {
        super();
        this.src = null;
        this.overrideStarts = new Hashtable();
        this.m_Overs = false;
        this._id = null;
    }
    
    get id() {
        return this._id;
    }
    set id(value) {
        this._id = value;
        return this._id;
    }
    
    get txt() {
        return this.src.txt;
    }
    
    get lvl() {
        return this.src.lvl;
    }
    
    get isBullet() {
        return this.src.isBullet;
    }
    
    toString() {
        let res = ("Id=" + this.id + " => " + this.src.toString());
        for (const kp of this.overrideStarts.entries) {
            res = (res + " Strrt[" + kp.key + "]=" + kp.value);
        }
        return res;
    }
    
    _prep() {
        if (!this.m_Overs) {
            for (const kp of this.overrideStarts.entries) {
                if (kp.key >= 0 && (kp.key < this.src.levels.length)) 
                    this.src.levels[kp.key].start = kp.value;
            }
            this.m_Overs = true;
        }
    }
    
    getLevel(lev) {
        this._prep();
        return this.src.getLevel(lev);
    }
    
    process(lev, init = false) {
        this._prep();
        return this.src.process(lev, init);
    }
    
    static _new437(_arg1) {
        let res = new UnitextGenNumStyleEx();
        res.src = _arg1;
        return res;
    }
}


module.exports = UnitextGenNumStyleEx