<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Sequence : CompositeTask {

    private int taskIndex = 0;

    public Sequence(string name) : base(name) { }

    override public ReturnCode Update()
    {
        var returnCode = tasks[taskIndex].Update();
        if (returnCode == ReturnCode.Succeed)
        {
            taskIndex++;
            if (taskIndex > tasks.Count)
                return ReturnCode.Succeed;
            else
                return ReturnCode.Running;
        }
        else
        {
            return returnCode;
        }
    }

    public override void Restart()
    {
        taskIndex = 0;
        base.Restart();
    }
}
<commit_msg>Fix out of range bug in sequence task.<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Sequence : CompositeTask {

    private int taskIndex = 0;

    public Sequence(string name) : base(name) { }

    override public ReturnCode Update()
    {
        var returnCode = tasks[taskIndex].Update();
        if (returnCode == ReturnCode.Succeed)
        {
            taskIndex++;
            if (taskIndex >= tasks.Count)
                return ReturnCode.Succeed;
            else
                return ReturnCode.Running;
        }
        else
        {
            return returnCode;
        }
    }

    public override void Restart()
    {
        taskIndex = 0;
        base.Restart();
    }
}

{'fraction_non_alphanumeric': 0.087248322147651, 'fraction_numerical': 0.0026845637583892616, 'mean_word_length': 1.776536312849162, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5146359', 'n_tokens_mistral': 408, 'n_tokens_neox': 389, 'n_words': 101}