<commit_before>﻿using System;
using Scripts.Model.Interfaces;
using UnityEngine;

namespace Scripts.Model.Processes {
    public class Grid : IButtonable {
        public const int DEFAULT_BUTTON_COUNT = 16;
        public static Action<IButtonable[]> ChangeGridFunc;

        public string Text;
        public string Tooltip;
        public Sprite Icon;
        public Action Action;
        public Func<bool> Condition;
        public IButtonable[] Array;

        public Grid(string text) {
            this.Text = text;
            this.Tooltip = "";
            this.Icon = null;
            this.Action = () => { };
            this.Condition = () => true;
            this.Array = new IButtonable[0];
        }

        public string ButtonText {
            get {
                return Text;
            }
        }

        public bool IsInvokable {
            get {
                return Condition.Invoke();
            }
        }

        public Sprite Sprite {
            get {
                return Icon;
            }<commit_msg>New grid constructor for backable grids.<commit_after>﻿using System;
using Scripts.Model.Interfaces;
using UnityEngine;

namespace Scripts.Model.Processes {
    public class Grid : IButtonable {
        public const int DEFAULT_BUTTON_COUNT = 16;
        public static Action<IButtonable[]> ChangeGridFunc;

        public string Text;
        public string Tooltip;
        public Sprite Icon;
        public Action Action;
        public Func<bool> Condition;
        public IButtonable[] Array;

        public Grid(string text) {
            this.Text = text;
            this.Tooltip = "";
            this.Icon = null;
            this.Action = () => { };
            this.Condition = () => true;
            this.Array = new IButtonable[0];
        }

        public Grid(Grid back, string text, params IButtonable[] content) : this(text) {
            this.Array = new IButtonable[content.Length + 1];
            Array[0] = back;

            int index = 1;
            foreach (IButtonable ib in content) {
                Array[index++] = ib;
            }
        }

        public string ButtonText {
            get {
                return Text;
            }
        }

        public bool IsInvokable {
            get {
                return Condition.Invoke();
            }
        }

        public Sprite Sprite {
            get {
                return Icon;
            }
{'fraction_non_alphanumeric': 0.08295872496935022, 'fraction_numerical': 0.0036779730281977932, 'mean_word_length': 1.4382470119521913, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '2347040', 'n_tokens_mistral': 629, 'n_tokens_neox': 607, 'n_words': 172}