<commit_before>/**
 * @constructor
 */
Melown.MapSurfaceTile = function(map_, parent_, id_) {
    this.map_ = map_;
    this.id_ = id_;
    this.parent_ = parent_;
    this.viewCounter_ = map_.viewCounter_;
    this.renderCounter_ = 0;
    this.renderReady_ = false;

    this.metanode_ = null;  //[metanode, cacheItem]
    this.lastMetanode_ = null;
    this.boundmetaresources_ = null; //link to bound layers metatile storage

    this.surface_ = null; //surface or glue
    this.surfaceMesh_ = null;
    this.surfaceGeodata_ = null; //probably only used in free layers
    this.surfaceTextures_ = [];

    this.virtual_ = false;
    this.virtualReady_ = false;
    this.virtualSurfaces_ = [];
    
    this.resetDrawCommands_ = false;
    this.drawCommands_ = [[], [], []];
    
    //this.empty_ = true;

    this.bounds_ = {};
    this.boundLayers_ = {};
    this.boundTextures_ = {};
    this.updateBounds_ = true;

    this.heightMap_ = null;
    this.drawCommands_ = [[], [], []];
    this.credits_ = [];
    
    this.resources_ = this.map_.resourcesTree_.findNode(id_, true);   // link to resource tree
    this.metaresources_ = this.map_.resourcesTree_.findAgregatedNode(id_, 8, true); //link to meta resource tree

    this.children_ = [null, null, null, null];
};

Melown.MapSurfaceTile.prototype.kill = function() {
    //kill children
    for (var i = 0; i < 4; i++) {
        if (this.children_[i] != null) {
            this.children_[i].kill();
        }
    }
/*
    if (this.surfaceMesh_ != null) {
        this.surfaceMesh_.kill();
    }<commit_msg>working resource tree<commit_after>/**
 * @constructor
 */
Melown.MapSurfaceTile = function(map_, parent_, id_) {
    this.map_ = map_;
    this.id_ = id_;
    this.parent_ = parent_;
    this.viewCounter_ = map_.viewCounter_;
    this.renderCounter_ = 0;
    this.renderReady_ = false;

    this.metanode_ = null;  //[metanode, cacheItem]
    this.lastMetanode_ = null;
    this.boundmetaresources_ = null; //link to bound layers metatile storage

    this.surface_ = null; //surface or glue
    this.surfaceMesh_ = null;
    this.surfaceGeodata_ = null; //probably only used in free layers
    this.surfaceTextures_ = [];

    this.virtual_ = false;
    this.virtualReady_ = false;
    this.virtualSurfaces_ = [];
    
    this.resetDrawCommands_ = false;
    this.drawCommands_ = [[], [], []];
    
    //this.empty_ = true;

    this.bounds_ = {};
    this.boundLayers_ = {};
    this.boundTextures_ = {};
    this.updateBounds_ = true;

    this.heightMap_ = null;
    this.drawCommands_ = [[], [], []];
    this.credits_ = [];
    
    this.resources_ = this.map_.resourcesTree_.findNode(id_, true);   // link to resource tree
    this.metaresources_ = this.map_.resourcesTree_.findAgregatedNode(id_, 5, true); //link to meta resource tree
    this.boundresources_ = this.map_.resourcesTree_.findAgregatedNode(id_, 8, true); //link to meta resource tree

    this.children_ = [null, null, null, null];
};

Melown.MapSurfaceTile.prototype.kill = function() {
    //kill children
    for (var i = 0; i < 4; i++) {
        if (this.children_[i] != null) {
            this.children_[i].kill();
        }
    }
/*
    if (this.surfaceMesh_ != null) {
        this.surfaceMesh_.kill();
    }
{'fraction_non_alphanumeric': 0.14040465971796443, 'fraction_numerical': 0.0027590435315757206, 'mean_word_length': 2.695356738391846, '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': '498097', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1054, 'n_words': 225}