<commit_before>import Animation from './Animation';

export default class AnimationGroup extends Animation {
    constructor(animations) {
        super();
        this._animations = animations;
    }

    start() {
        this._animations.forEach(animation => animation.start());
        super.start();
    }

    hasStarted() {
        const animations = this._animations;
        return animations.length === 0 || animations[0].hasStarted();
    }

    advance() {
    }

    onTick(delta) {
        this._animations.forEach(animation => animation.onTick(delta));
    }

    hasEnded() {
        const animations = this._animations;
        return animations.length === 0 || animations[0].hasEnded();
    }
}<commit_msg>Bugfix for animation group<commit_after>import Animation from './Animation';

export default class AnimationGroup extends Animation {
    constructor(animations) {
        super();
        this._animations = animations;
    }

    start() {
        this._animations.forEach(animation => animation.start());
        super.start();
    }

    hasStarted() {
        const animations = this._animations;
        return animations.length === 0 || animations[0].hasStarted();
    }
    
    advance() {
    }

    onTick(delta) {
        this._animations.forEach(animation => {
            if(!animation.hasEnded()) {
                animation.onTick(delta);
            }
        });
    }

    hasEnded() {
        const animations = this._animations;
        return animations.reduce(
            (prev, animation) => prev && animation.hasEnded(),
            true
        );
    }
}
{'fraction_non_alphanumeric': 0.12585669781931463, 'fraction_numerical': 0.003738317757009346, 'mean_word_length': 2.199203187250996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5826335', 'n_tokens_mistral': 452, 'n_tokens_neox': 419, 'n_words': 83}