/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Core/Collections/GuidCollection.cs
38 строк
944 B
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using System; using System.Collections.ObjectModel; namespace Unity.VisualScripting { public class GuidCollection<T> : KeyedCollection<Guid, T>, IKeyedCollection<Guid, T> where T : IIdentifiable { protected override Guid GetKeyForItem(T item) { return item.guid; } protected override void InsertItem(int index, T item) { Ensure.That(nameof(item)).IsNotNull(item); base.InsertItem(index, item); } protected override void SetItem(int index, T item) { Ensure.That(nameof(item)).IsNotNull(item); base.SetItem(index, item); } public new bool TryGetValue(Guid key, out T value) { if (Dictionary == null) { value = default(T); return false; } return Dictionary.TryGetValue(key, out value); } } }