/
smwwiki
/
OneScript_fork
Обзор
Документация
Войти
/
smwwiki
/
OneScript_fork
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/OneScript.Core/Values/BslPrimitiveValue.cs
39 строк
1 KB
EvilBeaver
Выделена отдельная папка для инфраструктуры исключений
24 июл 2023, 22:46
24 июл 2023, 22:46
d1c2e94
Код
Авторство
О чём код?
/*---------------------------------------------------------- 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.Exceptions; namespace OneScript.Values { public abstract class BslPrimitiveValue : BslValue { public override int CompareTo(BslValue other) { if (other == null) return -1; string typeOfThis = null; string typeOfOther = null; try { typeOfThis = this.SystemType.Name; typeOfOther = other.SystemType.Name; } catch (InvalidOperationException) // если тип не зарегистрирован { typeOfThis ??= GetType().ToString(); typeOfOther ??= GetType().ToString(); } throw RuntimeException.ComparisonNotSupportedException(typeOfThis, typeOfOther); } public override bool Equals(BslValue other) => false; } }