<commit_before>/*jshint evil:true */

/**
 * @namespace Lyria
 * Lyria namespace decleration
 */
;(function(window, Lyria, $, Handlebars, undefined) {
  'use strict';

  Lyria.Scene = (function() {
    
    var Scene = function(sceneName, sceneFunction, options) {
      if (!sceneName) {
        return;
      }
      
      this.name = sceneName;
      this.eventMap = new Lyria.EventMap();
      
      // Default values
      this.localization = {};
      this.events = {};
      
      var retValue = sceneFunction.call(this, this);
      
      
      if (this.localization) {
        var currentLocalization = this.localization['de'];
        
        retValue = $.extend(retValue, currentLocalization);
      }

      if (this.template) {
        this.content = this.template(retValue);
      }
    };
    
    Scene.prototype.add = function(gameObject) {
      if (gameObject instanceof Lyria.GameObject) {
        
      }
    };
    
    var methods = Object.keys(Lyria.EventMap.prototype);
    
    for (var i = 0, j = methods.length; i < j; i++) {
      (function(iterator) {
        Scene.prototype[iterator] = function() {<commit_msg>Re-added possibility to use events<commit_after>/*jshint evil:true */

/**
 * @namespace Lyria
 * Lyria namespace decleration
 */
;(function(window, Lyria, $, Handlebars, undefined) {
  'use strict';

  Lyria.Scene = (function() {
    
    var Scene = function(sceneName, sceneFunction, options) {
      if (!sceneName) {
        return;
      }
      
      this.name = sceneName;
      this.eventMap = new Lyria.EventMap();
      
      // Default values
      this.localization = {};
      this.events = {};
      
      var retValue = sceneFunction.call(this, this);
      
      if (retValue.events) {
        this.events = retValue.events;
      }
      
      if (this.localization) {
        var currentLocalization = this.localization['de'];
        
        retValue = $.extend(retValue, currentLocalization);
      }

      if (this.template) {
        this.content = this.template(retValue);
      }
      
      // Bind events
      if(!$.isEmptyObject(this.events)) {
        console.log('arbatos');
        
        if (options && options.isPrefab) {
          this.events.delegate = (options.target) ? options.target : 'body';              
        } else {
          this.events.delegate = '#' + sceneName;
        }
        
        var events = this.events;

        $.each(events, function(key, value) {
          if(( typeof value === 'object') && (key !== 'delegate')) {
            
            
            $(events.delegate).on(value, key);
          }
        });
      }
    };
    
    Scene.prototype.add = function(gameObject) {
      if (gameObject instanceof Lyria.GameObject) {
        
      }
    };
    
    var methods = Object.keys(Lyria.EventMap.prototype);
    
    for (var i = 0, j = methods.length; i < j; i++) {
      (function(iterator) {
        Scene.prototype[iterator] = function() {
{'fraction_non_alphanumeric': 0.13351224421335123, 'fraction_numerical': 0.0006709158000670916, 'mean_word_length': 1.8618042226487523, 'pattern_counts': {'":': 0, '<': 5, '<?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': '302962', 'n_tokens_mistral': 891, 'n_tokens_neox': 872, 'n_words': 174}