<commit_before>using System;

namespace LynnaLab
{

/// <summary>
///  An interaction object. The "index" is the full ID (2 bytes, including subid).
/// </summary>
public class InteractionObject : GameObject {

    Data objectData;

    byte b0,b1,b2;

    internal InteractionObject(Project p, int i) : base(p, i) {
        try {
            objectData = p.GetData("interactionData", ID*3);

            // If this points to more data, follow the pointer
            if (objectData.GetNumValues() == 1) {
                string label = objectData.GetValue(0);
                objectData = p.GetData(label);

                int count = SubID;
                while (count>0 && (objectData.GetIntValue(1)&0x80) == 0) {
                    count--;
                    objectData = objectData.NextData;
                }
            }

            b0 = (byte)objectData.GetIntValue(0);
            b1 = (byte)objectData.GetIntValue(1);
            b2 = (byte)objectData.GetIntValue(2);
        }
        catch(InvalidLookupException) {
            objectData = null;
        }
        catch(FormatException) {
            objectData = null;
        }
    }


    // GameObject properties
    public override string TypeName {
        get { return "Interaction"; }
    }

    public override ConstantsMapping IDConstantsMapping {
        get { return Project.InteractionMapping; }
    }


    public override bool DataValid {
        get { return objectData != null; }
    }

    public override byte ObjectGfxHeaderIndex {
        get { return b0; }
    }
    public override byte TileIndexBase {
        get { return (byte)(b1&0x7f); }
    }
    public override byte OamFlagsBase {
        get { return (byte)((b2>>4)&0xf); }
    }
    public override byte DefaultAnimationIndex {
        get { return (byte)(b2&0xf); }
    }
}
}
<commit_msg>Print exceptions when selecting invalid interaction<commit_after>using System;

namespace LynnaLab
{

/// <summary>
///  An interaction object. The "index" is the full ID (2 bytes, including subid).
/// </summary>
public class InteractionObject : GameObject {

    Data objectData;

    byte b0,b1,b2;

    internal InteractionObject(Project p, int i) : base(p, i) {
        try {
            objectData = p.GetData("interactionData", ID*3);

            // If this points to more data, follow the pointer
            if (objectData.GetNumValues() == 1) {
                string label = objectData.GetValue(0);
                objectData = p.GetData(label);

                int count = SubID;
                while (count>0 && (objectData.GetIntValue(1)&0x80) == 0) {
                    count--;
                    objectData = objectData.NextData;
                }
            }

            b0 = (byte)objectData.GetIntValue(0);
            b1 = (byte)objectData.GetIntValue(1);
            b2 = (byte)objectData.GetIntValue(2);
        }
        catch(InvalidLookupException e) {
            Console.WriteLine(e.ToString());
            objectData = null;
        }
        catch(FormatException e) {
            Console.WriteLine(e.ToString());
            objectData = null;
        }
    }


    // GameObject properties
    public override string TypeName {
        get { return "Interaction"; }
    }

    public override ConstantsMapping IDConstantsMapping {
        get { return Project.InteractionMapping; }
    }


    public override bool DataValid {
        get { return objectData != null; }
    }

    public override byte ObjectGfxHeaderIndex {
        get { return b0; }
    }
    public override byte TileIndexBase {
        get { return (byte)(b1&0x7f); }
    }
    public override byte OamFlagsBase {
        get { return (byte)((b2>>4)&0xf); }
    }
    public override byte DefaultAnimationIndex {
        get { return (byte)(b2&0xf); }
    }
}
}

{'fraction_non_alphanumeric': 0.10482180293501048, 'fraction_numerical': 0.014675052410901468, 'mean_word_length': 1.8742469879518073, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '3848267', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1057, 'n_words': 267}