import { BJ_Casino_Data } from "./BJ_Casino_Data";
import { Tools } from "./Tools";

export class BJ_Casino_Magnification {
    //#region Lifecycle

    public BJ_Casino: BJ_Casino_Data | undefined;

    //#endregion

    //#region private

    private _client: any;

    //#endregion

    //#region Lifecycle

    /**
     *
     */
    constructor(client: any) {
        this._client = client;
        this.BJ_Casino = client.BJ_Casino;
        this.onLoad();
    }

    public async onLoad() {
        await this.SetInit();
    };

    public async SetInit() {
        while (this.BJ_Casino?.Client.isLoading.value) {
            await Tools.Sleep(50);
        }
        this._client.Title.value = this.BJ_Casino?.Title;
        this.SendData();
    };

    //#endregion

    //#region Custom

    public SendData() {
        this._client.RankData.value = this.BJ_Casino?.RankMagnificationData;
    }

    //#endregion
}
