/* * 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 { /// /// A property in the syntax tree with a getter /// internal sealed class GetableProperty : TypedNode { // Backing field holding the getter node for this property. private Getter _getter; /// /// Getter of the property /// public ref readonly Getter Getter => ref _getter; /// /// Initializes a new getable property with no name/type/comment set. /// public GetableProperty() { } /// /// Initializes a new getable property with the provided name, type, optional getter and comment. /// /// Property name. /// Property type. /// Optional getter node. /// Optional XML summary comment. public GetableProperty(string name, string type, Getter getter = null, string comment = null) : base(name, type, comment) { _getter = getter; } /// /// Assigns a getter to this property. /// /// The getter to set. /// The same GetableProperty instance for fluent chaining. public GetableProperty WithGetter(Getter g) { _getter = g; return this; } } } #endif