<commit_before>﻿//ListeningComponentSolver
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using UnityEngine;

public class ListeningComponentSolver : ComponentSolver
{
    public ListeningComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
        base(bombCommander, bombComponent, ircConnection, canceller)
    {
        _buttons = new MonoBehaviour[4];
        _play = (MonoBehaviour)_playField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[0] = (MonoBehaviour)_dollarField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[1] = (MonoBehaviour)_poundField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[2] = (MonoBehaviour)_starField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[3] = (MonoBehaviour)_ampersandField.GetValue(bombComponent.GetComponent(_componentType));
    }

    protected override IEnumerator RespondToCommandInternal(string inputCommand)
    {
        MonoBehaviour button;

        var beforeStrikes = StrikeCount;

        var split = inputCommand.Trim().ToLowerInvariant().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (split.Length < 2 || split[0] != "press")
            yield break;

        if (_play == null || _buttons[0] == null || _buttons[1] == null || _buttons[2] == null || _buttons[3] == null)
            yield break;

        var letters = "$@*&";

        foreach (var cmd in split.Skip(1))
            switch (cmd)
            {
                case "play": if (split.Length > 2) yield break; break;
                default:
                    foreach(var x in cmd)
                        if (!letters.Contains(x))
                            yield break;
                    break;
            }   //Check for any invalid commands.  Abort entire sequence if any invalid commands are present.

        yield return "Listening Solve Attempt";
        foreach (var cmd in split.Skip(1))
        {
            switch (cmd)
            {
                case "play":<commit_msg>Whoops, while cleaning up, I typoed the letters in listening.<commit_after>﻿//ListeningComponentSolver
using System;
using System.Collections;
using System.Linq;
using System.Reflection;
using UnityEngine;

public class ListeningComponentSolver : ComponentSolver
{
    public ListeningComponentSolver(BombCommander bombCommander, MonoBehaviour bombComponent, IRCConnection ircConnection, CoroutineCanceller canceller) :
        base(bombCommander, bombComponent, ircConnection, canceller)
    {
        _buttons = new MonoBehaviour[4];
        _play = (MonoBehaviour)_playField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[0] = (MonoBehaviour)_dollarField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[1] = (MonoBehaviour)_poundField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[2] = (MonoBehaviour)_starField.GetValue(bombComponent.GetComponent(_componentType));
        _buttons[3] = (MonoBehaviour)_ampersandField.GetValue(bombComponent.GetComponent(_componentType));
    }

    protected override IEnumerator RespondToCommandInternal(string inputCommand)
    {
        MonoBehaviour button;

        var beforeStrikes = StrikeCount;

        var split = inputCommand.Trim().ToLowerInvariant().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        if (split.Length < 2 || split[0] != "press")
            yield break;

        if (_play == null || _buttons[0] == null || _buttons[1] == null || _buttons[2] == null || _buttons[3] == null)
            yield break;

        var letters = "$#*&";

        foreach (var cmd in split.Skip(1))
            switch (cmd)
            {
                case "play": if (split.Length > 2) yield break; break;
                default:
                    foreach(var x in cmd)
                        if (!letters.Contains(x))
                            yield break;
                    break;
            }   //Check for any invalid commands.  Abort entire sequence if any invalid commands are present.

        yield return "Listening Solve Attempt";
        foreach (var cmd in split.Skip(1))
        {
            switch (cmd)
            {
                case "play":
{'fraction_non_alphanumeric': 0.09871736142922584, 'fraction_numerical': 0.00641319285387082, 'mean_word_length': 2.697713801862828, 'pattern_counts': {'":': 4, '<': 5, '<?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': '828841', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1152, 'n_words': 268}