<commit_before>import EventEmitter from 'eventemitter3';
import { TRANSFORM_MODE } from '../const';
import settings from '../settings';
import { TransformStatic, Transform, Bounds, Rectangle } from '../math';
import { removeItems } from '../utils';
import Signal from 'engine/Signal';

/**
 * A Node2D represents a collection of display objects.
 * It is the base class of all display objects that act as a container for other objects.
 *
 *```js
 * let container = new V.Node2D();
 * container.add_child(sprite);
 * ```
 *
 * @class
 * @extends EventEmitter
 * @memberof V
 */
export default class Node2D extends EventEmitter
{
    /**
     *
     */
    constructor()
    {
        super();

        const TransformClass = settings.TRANSFORM_MODE === TRANSFORM_MODE.STATIC ? TransformStatic : Transform;

        this.tempNode2DParent = null;

        this.name = '';
        this.type = 'Node2D';

        this.is_inside_tree = false;

        this.idle_process = false;

        // TODO: need to create Transform from factory
        /**
         * World transform and local transform of this object.
         * This will become read-only later, please do not assign anything there unless you know what are you doing
         *
         * @member {V.TransformBase}
         */
        this.transform = new TransformClass();

        /**
         * The opacity of the object.
         *
         * @member {number}
         */
        this.alpha = 1;
<commit_msg>Add an id field to Node2D<commit_after>import EventEmitter from 'eventemitter3';
import { TRANSFORM_MODE } from '../const';
import settings from '../settings';
import { TransformStatic, Transform, Bounds, Rectangle } from '../math';
import { removeItems } from '../utils';
import Signal from 'engine/Signal';

let uid = 0;

/**
 * A Node2D represents a collection of display objects.
 * It is the base class of all display objects that act as a container for other objects.
 *
 *```js
 * let container = new V.Node2D();
 * container.add_child(sprite);
 * ```
 *
 * @class
 * @extends EventEmitter
 * @memberof V
 */
export default class Node2D extends EventEmitter
{
    /**
     *
     */
    constructor()
    {
        super();

        const TransformClass = settings.TRANSFORM_MODE === TRANSFORM_MODE.STATIC ? TransformStatic : Transform;

        this.tempNode2DParent = null;

        this.id = uid++;

        this.name = '';
        this.type = 'Node2D';

        this.is_inside_tree = false;
        this.is_queued_for_deletion = false;

        this.idle_process = false;

        // TODO: need to create Transform from factory
        /**
         * World transform and local transform of this object.
         * This will become read-only later, please do not assign anything there unless you know what are you doing
         *
         * @member {V.TransformBase}
         */
        this.transform = new TransformClass();

        /**
         * The opacity of the object.
         *
         * @member {number}
         */
        this.alpha = 1;

{'fraction_non_alphanumeric': 0.10828656322218554, 'fraction_numerical': 0.005282271376691978, 'mean_word_length': 2.3006535947712417, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6415557', 'n_tokens_mistral': 856, 'n_tokens_neox': 820, 'n_words': 278}