/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/OneScript.Core/Values/BslAnnotationValue.cs
58 строк
2 KB
Sergey Batanov
Убрана завязка на константы образа.
31 авг 2025, 19:27
31 авг 2025, 19:27
a2fa4ea
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using OneScript.Contexts; using OneScript.Exceptions; using OneScript.Localization; using OneScript.Types; using System.Collections.Generic; using System.Text; namespace OneScript.Values { public sealed class BslAnnotationValue : BslPrimitiveValue { public BslAnnotationValue(string name) { Name = name; } public string Name { get; } public List<BslAnnotationParameter> Parameters { get; } = new List<BslAnnotationParameter>(); public override int CompareTo(BslValue other) { var msg = new BilingualString("Сравнение на больше/меньше для данного типа не поддерживается", "Comparison for less/greater is not supported for this type"); throw new RuntimeException(msg); } public override bool Equals(BslValue other) { return ReferenceEquals(this, other); } public override string ToString() { var sb = new StringBuilder("&"); sb.Append(Name); if (Parameters.Count != 0) { var prefix = "("; foreach (var parameter in Parameters) { sb.Append(prefix); sb.Append(parameter); prefix = ","; } sb.Append(")"); } return sb.ToString(); } } }