<commit_before>(function () {
  'use strict';

  /*---------------------
  ------- IMPORT --------
  ----------------------*/
  var { Q, PIXI } = window.flatworld_libraries;
  var { mapLayers, ObjectManager, mapEvents, MapDataManipulator, generalUtils, log }  = window.flatworld;

  /*---------------------
  ------ VARIABLES ------
  ----------------------*/
  const LAYER_TYPE_STATIC = 0;
  const LAYER_TYPE_MOVABLE = 1;
  const VERSION = "0.0.1";
  var _drawMapOnNextTick = false;
  var isMapReadyPromises = [];
  var _staticLayer, _movableLayer, _renderer, ParentLayerConstructor;

  /*---------------------
  --------- API ---------
  ----------------------*/
  class Flatworld {
    /**
     * #Main class for the engine
     *
     * Initializes the whole structure and plugins and is used as primary API for all operations. This class is e.g. passed to every
     * plugin that get initialized with their init-method.
     *
     * You use the class by instantiating it (new) and then finishing initialization with init-method. Please see examples below.
     *
     * The biggest part of creating the map, is the data structure. There is a clear data structure that you can see from the
     * tests/data-folder, but the factory is responsible for creating the objects, so you can use your own factory implementation. So to
     * understand more, please see e.g. factories.horizontalHexaFactory.
     *
     * The map consists of layer on top of each other. The example is best understood when thinking typical war strategy game. The
     * structure is this:
     * 1. StaticLayer: Handles things like scaling / zooming the map
     * 2. MovableLayer: Obviously handles movement of the map. Also is a good place to get map coordinates. Since getting global
     * coordinates won't help you much, half of the time.
     * 3. Different layers: like units, terrain, fog of war, UIs etc. Can also contains special layers like dynamically changed UIlayers.
     * 4. possible subcontainers (used for optimized object selection and map movement). Can also contains special layers like dynamically
     * changed UIlayers.
     * 5. Individual objects, like units, terrains, cities etc...
     *
     * Plugins can be added with activatePlugins-method by sending them to the class. Plugins must always implement init-method, which
     * receives Map instance. Plugins are not yet restricted what they can do and can add functionality without touching map or can modify
     * objects or their prototypes through access to Map instance.
     *
     * @example
     *     var map = new Map(divContainer, mapOptions );
     *     promises = map.init( gameData.pluginsToActivate, mapData.startPoint );
     *
     * @class Map
     * @constructor
     * @requires PIXI.JS framework in global namespace
     * @requires Canvas (webGL support recommended) HTML5-element supported.
     * @requires Q for promises
     * @requires Hammer for touch events
     * @requires Hamster for mouse scroll events
     *
     * @param {HTMLElement} canvasContainer                 HTML element which will be container for the created canvas element. REQUIRED
     * @param {Object} props                                Extra properties
     * @param {Object} props.bounds                         Bounds of the map / mapSize
     * @param {Integer} props.bounds.width                  Bound width
     * @param {Integer} props.bounds.height                 Bound height
     * @param {Object} props.rendererOptions                Renderer options passed to PIXI.autoDetectRenderer
     * @param {Object} props.subcontainers                  Subcontainers size in pixels. If given, will activate subcontainers. If not
     * given or false, subcontainers are not used.area.
     * @param {Integer} props.subcontainers.width           Subcontainer width
     * @param {Integer} props.subcontainers.height          Subcontainer height
     * @param {FPSCallback} trackFPSCB                      Callback function for tracking FPS in renderer. So this is used for debugging
     * and optimizing.
     *
     * @return {Object}                                      New Map instance
     */
    constructor(canvasContainer = null,<commit_msg>renamed map -> Flatworld for documentation<commit_after>(function () {
  'use strict';

  /*---------------------
  ------- IMPORT --------
  ----------------------*/
  var { Q, PIXI } = window.flatworld_libraries;
  var { mapLayers, ObjectManager, mapEvents, MapDataManipulator, generalUtils, log }  = window.flatworld;

  /*---------------------
  ------ VARIABLES ------
  ----------------------*/
  const LAYER_TYPE_STATIC = 0;
  const LAYER_TYPE_MOVABLE = 1;
  const VERSION = "0.0.1";
  var _drawMapOnNextTick = false;
  var isMapReadyPromises = [];
  var _staticLayer, _movableLayer, _renderer, ParentLayerConstructor;

  /*---------------------
  --------- API ---------
  ----------------------*/
  class Flatworld {
    /**
     * #Main class for the engine
     *
     * Initializes the whole structure and plugins and is used as primary API for all operations. This class is e.g. passed to every
     * plugin that get initialized with their init-method.
     *
     * You use the class by instantiating it (new) and then finishing initialization with init-method. Please see examples below.
     *
     * The biggest part of creating the map, is the data structure. There is a clear data structure that you can see from the
     * tests/data-folder, but the factory is responsible for creating the objects, so you can use your own factory implementation. So to
     * understand more, please see e.g. factories.horizontalHexaFactory.
     *
     * The map consists of layer on top of each other. The example is best understood when thinking typical war strategy game. The
     * structure is this:
     * 1. StaticLayer: Handles things like scaling / zooming the map
     * 2. MovableLayer: Obviously handles movement of the map. Also is a good place to get map coordinates. Since getting global
     * coordinates won't help you much, half of the time.
     * 3. Different layers: like units, terrain, fog of war, UIs etc. Can also contains special layers like dynamically changed UIlayers.
     * 4. possible subcontainers (used for optimized object selection and map movement). Can also contains special layers like dynamically
     * changed UIlayers.
     * 5. Individual objects, like units, terrains, cities etc...
     *
     * Plugins can be added with activatePlugins-method by sending them to the class. Plugins must always implement init-method, which
     * receives Map instance. Plugins are not yet restricted what they can do and can add functionality without touching map or can modify
     * objects or their prototypes through access to Map instance.
     *
     * @example
     *     var map = new Map(divContainer, mapOptions );
     *     promises = map.init( gameData.pluginsToActivate, mapData.startPoint );
     *
     * @class Flatworld
     * @constructor
     * @requires PIXI.JS framework in global namespace
     * @requires Canvas (webGL support recommended) HTML5-element supported.
     * @requires Q for promises
     * @requires Hammer for touch events
     * @requires Hamster for mouse scroll events
     *
     * @param {HTMLElement} canvasContainer                 HTML element which will be container for the created canvas element. REQUIRED
     * @param {Object} props                                Extra properties
     * @param {Object} props.bounds                         Bounds of the map / mapSize
     * @param {Integer} props.bounds.width                  Bound width
     * @param {Integer} props.bounds.height                 Bound height
     * @param {Object} props.rendererOptions                Renderer options passed to PIXI.autoDetectRenderer
     * @param {Object} props.subcontainers                  Subcontainers size in pixels. If given, will activate subcontainers. If not
     * given or false, subcontainers are not used.area.
     * @param {Integer} props.subcontainers.width           Subcontainer width
     * @param {Integer} props.subcontainers.height          Subcontainer height
     * @param {FPSCallback} trackFPSCB                      Callback function for tracking FPS in renderer. So this is used for debugging
     * and optimizing.
     *
     * @return {Object}                                      New Map instance
     */
    constructor(canvasContainer = null,
{'fraction_non_alphanumeric': 0.10253388332351208, 'fraction_numerical': 0.0025928108426635237, 'mean_word_length': 2.227843286420692, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5612271', 'n_tokens_mistral': 2137, 'n_tokens_neox': 2052, 'n_words': 889}