<commit_before>//
// createFoodServer.js
// 
// Author: <NAME>
// Modified from "ShatterPlateServer.js" by <NAME>
// Copyright High Fidelity 2018
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//

/* globals Entities, Uuid */

(function(){
    var LIFETIME = 30; // seconds
    var CHECK_INTERVAL = LIFETIME * 100; // milliseconds
    var CRUNH_SCRIPT = Script.resolvePath("./crunch.js");
    var MAX_FOOD = 5;
    var DEBUG = false;

    var foodProperties; 
    var spawnFoodInterval;
    var foodArray = [];
    
    var FoodSpawner = function(){
        // nothing here
    };

    FoodSpawner.prototype = {
        preload: function(entityID) {
            if (DEBUG) {
                print("preload for createFoodServer.js");
            }
            var properties = Entities.getEntityProperties(entityID, 
                ["position", "dimensions", "modelURL", "name", "dimensions", "description"]);
            foodProperties = {
                type: "Model",
                shapeType: "capsule-z",
                modelURL: properties.modelURL,
                script: CRUNH_SCRIPT,
                lifetime: LIFETIME,
                position: properties.position,
                dimensions: properties.dimensions,
                dynamic: true,
                gravity: {x: 0, y: 0, z: 0},
                collisionless: true,
                visible: true,
                userData : "{\"grabbableKey\":{\"grabbable\":true}}"
            };        
            spawnFoodInterval = Script.setInterval(function() {
                if (foodArray.length < MAX_FOOD) {
                    var foodID = Entities.addEntity(foodProperties);
                    foodArray.push(foodID);
                } else {
                    foodArray.pop();
                }
                
            }, CHECK_INTERVAL);
        },<commit_msg>added clone name, description, fixed typo<commit_after>//
// createFoodServer.js
// 
// Author: <NAME>
// Modified from "ShatterPlateServer.js" by <NAME>
// Copyright High Fidelity 2018
//
// Licensed under the Apache 2.0 License
// See accompanying license file or http://apache.org/
//

/* globals Entities, Uuid */

(function(){
    var LIFETIME = 30; // seconds
    var CHECK_INTERVAL = LIFETIME * 100; // milliseconds
    var CRUNCH_SCRIPT = Script.resolvePath("./crunch.js");
    var MAX_FOOD = 5;
    var DEBUG = false;

    var foodProperties; 
    var spawnFoodInterval;
    var foodArray = [];
    
    var FoodSpawner = function(){
        // nothing here
    };

    FoodSpawner.prototype = {
        preload: function(entityID) {
            if (DEBUG) {
                print("preload for createFoodServer.js");
            }
            var properties = Entities.getEntityProperties(entityID, 
                ["position", "rotation", "dimensions", "modelURL", "name", "dimensions", "description"]);
            foodProperties = {
                name: properties.name + "-clone",
                descript: properties.description,
                type: "Model",
                shapeType: "compound",
                modelURL: properties.modelURL,
                script: CRUNCH_SCRIPT,
                lifetime: LIFETIME,
                position: properties.position,
                rotation: properties.rotation,
                dimensions: properties.dimensions,
                dynamic: true,
                gravity: {x: 0, y: 0, z: 0},
                collisionless: true,
                visible: false,
                grabbable: true
            };        
            spawnFoodInterval = Script.setInterval(function() {
                if (foodArray.length < MAX_FOOD) {
                    var foodID = Entities.addEntity(foodProperties);
                    foodArray.push(foodID);
                } else {
                    foodArray.pop();
                }
                
            }, CHECK_INTERVAL);
        },
{'fraction_non_alphanumeric': 0.11018237082066869, 'fraction_numerical': 0.007598784194528876, 'mean_word_length': 1.5759947814742334, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 7, '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': '5707226', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1032, 'n_words': 247}