/* * SPDX-License-Identifier: AGPL-3.0-or-later * Copyright (C) 2025 Sergej Görzen * This file is part of xAPI4Unity. */ #if UNITY_EDITOR namespace xAPI4Unity.Editor.Parser.Code.SyntaxTree { /// /// Represents a property in the syntax tree. /// A Property is a node that has a name, a type, and can optionally hold an initializer. /// internal class Property : TypedNode { /// /// The initializer for the property (e.g., default value assignment). /// public string Initializer { get; set; } /// /// Initializes an empty instance of the Property class. /// public Property() { } /// /// Assigns an initializer to the property. /// /// The initializer value as a string. /// The same Property instance for fluent chaining. public Property WithInitializer(string initializer) { this.Initializer = initializer; return this; } /// /// Initializes a Property with the specified name, type, and optional comment. /// /// The name of the property. /// The data type of the property. /// An optional comment/description for the property. public Property(string name, string type, string comment = null) : base(name, type, comment) { } } } #endif