<commit_before>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2015, <NAME>, <NAME>, <NAME>
 * http://www.melonjs.org
 *
 */
(function () {
    /**
     * a level manager object <br>
     * once ressources loaded, the level director contains all references of defined levels<br>
     * There is no constructor function for me.levelDirector, this is a static object
     * @namespace me.levelDirector
     * @memberOf me
     */
    me.levelDirector = (function () {
        // hold public stuff in our singletong
        var api = {};

        /*
         * PRIVATE STUFF
         */

        // our levels
        var levels = {};
        // level index table
        var levelIdx = [];
        // current level index
        var currentLevelIdx = 0;

        function safeLoadLevel(levelId, options, restart) {
            // clean the destination container
            options.container.destroy();

            // clean the current (previous) level
            if (levels[api.getCurrentLevelId()]) {
                levels[api.getCurrentLevelId()].destroy();
            }

            // update current level index
            currentLevelIdx = levelIdx.indexOf(levelId);

            // add the specified level to the game world<commit_msg>[#455] Reset the renderer to prevent an excepton in the WebGLRenderer when loading maps<commit_after>/*
 * MelonJS Game Engine
 * Copyright (C) 2011 - 2015, <NAME>, <NAME>, <NAME>
 * http://www.melonjs.org
 *
 */
(function () {
    /**
     * a level manager object <br>
     * once ressources loaded, the level director contains all references of defined levels<br>
     * There is no constructor function for me.levelDirector, this is a static object
     * @namespace me.levelDirector
     * @memberOf me
     */
    me.levelDirector = (function () {
        // hold public stuff in our singletong
        var api = {};

        /*
         * PRIVATE STUFF
         */

        // our levels
        var levels = {};
        // level index table
        var levelIdx = [];
        // current level index
        var currentLevelIdx = 0;

        function safeLoadLevel(levelId, options, restart) {
            // clean the destination container
            options.container.destroy();

            // reset the renderer
            me.video.renderer.reset();

            // clean the current (previous) level
            if (levels[api.getCurrentLevelId()]) {
                levels[api.getCurrentLevelId()].destroy();
            }

            // update current level index
            currentLevelIdx = levelIdx.indexOf(levelId);

            // add the specified level to the game world
{'fraction_non_alphanumeric': 0.10105980317940953, 'fraction_numerical': 0.007948523845571537, 'mean_word_length': 1.8572972972972972, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4197323', 'n_tokens_mistral': 701, 'n_tokens_neox': 657, 'n_words': 224}