<commit_before>import * as PIXI from "pixi.js";
import {Scene} from "./scene";

export class ScenesManager 
{
    private static scenes: any = {}; // should be hashmap but a JS object is fine too :)
    public static currentScene: Scene;
    public static renderer: PIXI.GraphicsRenderer;

    public static create(width: number, height: number) {
        if (ScenesManager.renderer) return this;

        ScenesManager.renderer = PIXI.autoDetectRenderer(width, height);
        document.body.appendChild(ScenesManager.renderer.view);
        requestAnimFrame(ScenesManager.loop);
        return this;
    }
    private static loop() {
        requestAnimFrame(function () { ScenesManager.loop() });

        if (!currentScene || currentScene.isPaused()) return;
        currentScene.update();
        ScenesManager.renderer.render(currentScene);
    }
}<commit_msg>louche<commit_after>import * as PIXI from "pixi.js";
import {Scene} from "./scene";

export class ScenesManager 
{
    private  scenes: any = {}; // should be hashmap but a JS object is fine too :)
    public  currentScene: Scene;
    public  renderer: PIXI.WebGLRenderer|PIXI.CanvasRenderer;

    public  create(width: number, height: number) {
        if (this.renderer) return this;

        this.renderer = PIXI.autoDetectRenderer(width, height);
        document.body.appendChild(this.renderer.view);
        requestAnimationFrame(this.loop);
        return this;
    }
    private  loop() {
        requestAnimationFrame(function () { this.loop() });

        if (!this.currentScene || this.currentScene.isPaused()) return;
        this.currentScene.update();
        this.renderer.render(this.currentScene);
    }
}
{'fraction_non_alphanumeric': 0.11374407582938388, 'fraction_numerical': 0.0, 'mean_word_length': 3.139705882352941, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1432199', 'n_tokens_mistral': 485, 'n_tokens_neox': 479, 'n_words': 119}