/* * 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 { /// /// An import of the syntax tree /// internal sealed class Import { /// /// Target to import (i.e., a class) /// public string Target { get; private set; } /// /// Source to import from (i.e. a package) /// public string Source { get; private set; } /// /// Initializes an empty import. /// public Import() { } /// /// Initializes an import with a target (and optional source). /// /// The symbol or namespace being imported. /// Optional source/package/module identifier. public Import(string target, string source = null) { Target = target; Source = source; } /// /// Sets the import target. /// /// The symbol or namespace being imported. /// The same Import instance for fluent chaining. public Import WithTarget(string target) { Target = target; return this; } /// /// Sets the import source. /// /// The package/module identifier. /// The same Import instance for fluent chaining. public Import WithSource(string source) { Source = source; return this; } } } #endif