/* * 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 parameter in the syntax tree /// internal sealed class Parameter { /// /// name of the parameter /// public string Name { get; private set; } /// /// Type of the parameter /// public string Type { get; private set; } /// /// Default value of the parameter /// public object DefaultValue { get; private set; } /// /// Initializes an empty parameter with no name, type, or default value. /// public Parameter() { } /// /// Initializes a parameter with a specified name, type, and optional default value. /// /// The name of the parameter. /// The data type of the parameter. Can be null. /// The optional default value for the parameter. public Parameter(string name, string type = null, object defaultValue = null) { Name = name; Type = type; DefaultValue = defaultValue; } /// /// Sets the name for the parameter. /// /// The name to assign to the parameter. /// The same Parameter instance for fluent chaining. public Parameter WithName(string name) { Name = name; return this; } /// /// Sets the type for the parameter. /// /// The type to assign to the parameter. /// The same Parameter instance for fluent chaining. public Parameter WithType(string type) { Type = type; return this; } /// /// Sets the default value for the parameter. /// /// The default value to assign to the parameter. /// The same Parameter instance for fluent chaining. public Parameter WithDefVal(object defaultValue) { DefaultValue = defaultValue; return this; } } } #endif