let wantedCount = 0;

export default function wanteds(globalData: IGlobalData) {
    var browser = mp.browsers.new("package://assets/html/wanteds/index.html");

    mp.events.add("SERVER:SetWanteds", (count: number) => {
        browser.execute(`setWanteds(${count});`);
        wantedCount = count;
    });


    mp.events.add("SERVER:SetWantedFlash", (flash) => {
        browser.execute(`setFlashing(${flash});`);
    });
}

export function getWantedCount(): number {
    return wantedCount;
}