<commit_before>package jascii.display;

class Object
{
    public var x(default, set_x):Int;
    public var y(default, set_y):Int;
    public var width(default, set_width):Int;
    public var height(default, set_height):Int;

    public var absolute_x(get_absolute_x, null):Int;
    public var absolute_y(get_absolute_y, null):Int;

    public var parent:ObjectContainer;
    public var surface(get_surface, null):Surface;

    public var autoresize:Bool;
    public var dirty:Bool;

    public function new()
    {
        this.x = 0;
        this.y = 0;
        this.width = 0;
        this.height = 0;

        this.parent = null;

        this.autoresize = true;
        this.dirty = true;
    }

    private inline function set_x(val:Int):Int
    {
        this.dirty = true;
        return this.x = val;
    }

    private inline function set_y(val:Int):Int
    {
        this.dirty = true;
        return this.y = val;
    }

    private function autogrow_width():Void
    {
        if (this.parent == null || !this.parent.autoresize)
            return;

        if (this.x + this.width > this.parent.width)
            this.parent.width = this.x + this.width;
    }

    private function autogrow_height():Void
    {
        if (this.parent == null || !this.parent.autoresize)
            return;

        if (this.y + this.height > this.parent.height)
            this.parent.height = this.y + this.height;
    }

    private function set_width(val:Int):Int
    {
        this.dirty = true;

        this.width = val;
        this.autogrow_width();

        return this.width;<commit_msg>Object: Add z attribute for ordering.<commit_after>package jascii.display;

class Object
{
    public var x(default, set_x):Int;
    public var y(default, set_y):Int;
    public var z(default, set_z):Int;
    public var width(default, set_width):Int;
    public var height(default, set_height):Int;

    public var absolute_x(get_absolute_x, null):Int;
    public var absolute_y(get_absolute_y, null):Int;

    public var parent:ObjectContainer;
    public var surface(get_surface, null):Surface;

    public var autoresize:Bool;
    public var dirty:Bool;

    public function new()
    {
        this.x = 0;
        this.y = 0;
        this.z = 0;
        this.width = 0;
        this.height = 0;

        this.parent = null;

        this.autoresize = true;
        this.dirty = true;
    }

    private inline function set_x(val:Int):Int
    {
        this.dirty = true;
        return this.x = val;
    }

    private inline function set_y(val:Int):Int
    {
        this.dirty = true;
        return this.y = val;
    }

    private inline function set_z(val:Int):Int
    {
        this.dirty = true;
        return this.z = val;
    }

    private function autogrow_width():Void
    {
        if (this.parent == null || !this.parent.autoresize)
            return;

        if (this.x + this.width > this.parent.width)
            this.parent.width = this.x + this.width;
    }

    private function autogrow_height():Void
    {
        if (this.parent == null || !this.parent.autoresize)
            return;

        if (this.y + this.height > this.parent.height)
            this.parent.height = this.y + this.height;
    }

    private function set_width(val:Int):Int
    {
        this.dirty = true;

        this.width = val;
        this.autogrow_width();

        return this.width;
{'fraction_non_alphanumeric': 0.10960518562168532, 'fraction_numerical': 0.0026517383618149676, 'mean_word_length': 2.089171974522293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3794217', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1056, 'n_words': 251}