/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Core/Collections/VariantKeyedCollection.cs
37 строк
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
namespace Unity.VisualScripting { public class VariantKeyedCollection<TBase, TImplementation, TKey> : VariantCollection<TBase, TImplementation>, IKeyedCollection<TKey, TBase> where TImplementation : TBase { public VariantKeyedCollection(IKeyedCollection<TKey, TImplementation> implementation) : base(implementation) { this.implementation = implementation; } public TBase this[TKey key] => implementation[key]; public new IKeyedCollection<TKey, TImplementation> implementation { get; private set; } public bool TryGetValue(TKey key, out TBase value) { TImplementation implementationValue; var result = implementation.TryGetValue(key, out implementationValue); value = implementationValue; return result; } public bool Contains(TKey key) { return implementation.Contains(key); } public bool Remove(TKey key) { return implementation.Remove(key); } TBase IKeyedCollection<TKey, TBase>.this[int index] => implementation[index]; } }