<commit_before>"use strict";

function SimpleCounter() {

    this.type = 'controller';
    this.state = 'paused';

    this.settings = {
        'id': {
            'name': 'ID',
            'type': 'text',
            'initialValue': 'simple_counter_1',
            'value': 'simple_counter_1',
        },
        'objectID': {
            'name': 'Object ID',
            'type': 'objectList',
            'initialValue': '',
            'value': '',
        },
        'value': {
            'name': 'Value',
            'type': 'number',
            'initialValue': 0,
            'value': 0,
        },
        'step': {
            'name': 'Step size',
            'type': 'number',
            'initialValue': 0,
            'value': 0,
        },
    };

    this.initialize = function() {
        var object = WebGameMaker.Game.getPluginById(
                this.settings.objectID.value);
        object.addCollisionHandler(bind(this, function(obj, info) {
            if (this.state != 'playing') {
                return;
            }
            this.settings.value.value += this.settings.step.value;
        }));
    };

    this.play = function() {
        this.state = 'playing';
    };

    this.pause = function() {
        this.state = 'paused';
        this.value.value = this.value.initialValue;
        this.step.value = this.step.initialValue;
    };

    this.reset = function() {
        this.pause();
    };

}

SimpleCounter.prototype.name = 'Simple counter';
SimpleCounter.prototype.description = 'A very simple plugin that lets you increment ' +
                                      'or decrement an integer with a fixed value.';

WebGameMaker.PluginManager.registerPlugin(SimpleCounter);<commit_msg>Updating name of SimpleCounter to be SimpleCounter to match the other plugin names<commit_after>"use strict";

function SimpleCounter() {

    this.type = 'controller';
    this.state = 'paused';

    this.settings = {
        'id': {
            'name': 'ID',
            'type': 'text',
            'initialValue': 'simple_counter_1',
            'value': 'simple_counter_1',
        },
        'objectID': {
            'name': 'Object ID',
            'type': 'objectList',
            'initialValue': '',
            'value': '',
        },
        'value': {
            'name': 'Value',
            'type': 'number',
            'initialValue': 0,
            'value': 0,
        },
        'step': {
            'name': 'Step size',
            'type': 'number',
            'initialValue': 0,
            'value': 0,
        },
    };

    this.initialize = function() {
        var object = WebGameMaker.Game.getPluginById(
                this.settings.objectID.value);
        object.addCollisionHandler(bind(this, function(obj, info) {
            if (this.state != 'playing') {
                return;
            }
            this.settings.value.value += this.settings.step.value;
        }));
    };

    this.play = function() {
        this.state = 'playing';
    };

    this.pause = function() {
        this.state = 'paused';
        this.value.value = this.value.initialValue;
        this.step.value = this.step.initialValue;
    };

    this.reset = function() {
        this.pause();
    };

}

SimpleCounter.prototype.name = 'SimpleCounter';
SimpleCounter.prototype.description = 'A very simple plugin that lets you increment ' +
                                      'or decrement an integer with a fixed value.';

WebGameMaker.PluginManager.registerPlugin(SimpleCounter);
{'fraction_non_alphanumeric': 0.14269535673839184, 'fraction_numerical': 0.0033975084937712344, 'mean_word_length': 1.6484257871064467, 'pattern_counts': {'":': 0, '<': 3, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7556761', 'n_tokens_mistral': 1000, 'n_tokens_neox': 969, 'n_words': 202}