<commit_before>function TweenManager(){

}

TweenManager.prototype.constructor = TweenManager;

module.exports = TweenManager;<commit_msg>Tween manager done<commit_after>var Twee = require('./Tween');

function TweenManager(){
    this.tweens = [];
    this._toDelete = [];
}

TweenManager.prototype.constructor = TweenManager;

TweenManager.prototype.tick = function(delta){
    var len = this.tweens.length;
    for(var i = 0; i < len; i++){
        if(this.tweens[i].active){
            this.tweens[i].tick(delta);
            if(this.tweens[i].isEnded && this.tweens[i].expire){
                this.tweens[i].remove();
            }
        }
    }

    var rLen = this._toDelete.length;
    if(rLen >= 1) {
        for (i = 0; i < rLen; i++) {
            this._remove(this._toDelete[i]);
        }

        this._toDelete.length = 0;
    }

    return this;
};

TweenManager.prototype.getTweensForTarget = function(target){
    var len = this.tweens.length;
    var tweens = [];
    for(var i = 0; i < len; i++){
        if(this.tweens[i].target === target){
            tweens.push(this.tweens[i]);
        }
    }

    return tweens;
};

TweenManager.prototype.createTween = function(target){
    return new Tween(target, this);
};

TweenManager.prototype.addTween = function(tween){
    this.tweens.push(tween);
    return this;
};

TweenManager.prototype.removeTimer = function(tween){
    this._toDelete.push(tween);
    return this;
};

TweenManager.prototype._remove = function(tween){
    var index = this.tweens.indexOf(tween);
    if(index >= 0){
        this.tweens.splice(index, 1);
    }
};

module.exports = TweenManager;
{'fraction_non_alphanumeric': 0.1503347534996957, 'fraction_numerical': 0.00426049908703591, 'mean_word_length': 2.727891156462585, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '5254787', 'n_tokens_mistral': 577, 'n_tokens_neox': 564, 'n_words': 93}