Class MaterialInputs<T>
Namespace: ValveResourceFormat.Renderer.Materials
Assembly: Renderer.dll
A 's inputs of one type, keyed by uniform name.
public sealed class MaterialInputs<T> : IReadOnlyDictionary<string, T>, IReadOnlyCollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerableType Parameters
T
The value type.
Inheritance
Implements
IReadOnlyDictionary<string, T>, IReadOnlyCollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }Property Value
Keys
Gets the parameter names.
public Dictionary<string, T>.KeyCollection Keys { get; }Property Value
Dictionary<string, T>.KeyCollection
Values
Gets the parameter values.
public Dictionary<string, T>.ValueCollection Values { get; }Property Value
Dictionary<string, T>.ValueCollection
Version
Gets a value that changes every time an entry is added, removed, or set to a different value. Combine several of these by summing them; any one of them changing changes the sum.
public uint Version { get; }Property Value
this[string]
Gets or sets the value for the given parameter name. Setting counts as a change only when the value differs from what was there, so rewriting the same value every frame costs nothing.
public T this[string key] { get; set; }Property Value
T
Methods
Add(string, T)
Adds a parameter, throwing if it is already present. Counts as a change.
public void Add(string key, T value)Parameters
key string
value T
Clear()
Removes every parameter. Counts as a change when there was anything to remove.
public void Clear()ContainsKey(string)
Determines whether the read-only dictionary contains an element that has the specified key.
public bool ContainsKey(string key)Parameters
key string
The key to locate.
Returns
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
key is null.
EnsureCapacity(int)
Ensures the backing storage can hold the given number of parameters without resizing.
public int EnsureCapacity(int capacity)Parameters
capacity int
The minimum number of parameters to make room for.
Returns
The resulting capacity.
GetAlternateLookup<TAlternate>()
Returns a lookup into the same storage keyed by an alternate type, typically a
of , to avoid allocating a string per probe.public Dictionary<string, T>.AlternateLookup<TAlternate> GetAlternateLookup<TAlternate>() where TAlternate : notnull, allows ref structReturns
Dictionary<string, T>.AlternateLookup<TAlternate>
Type Parameters
TAlternate
The alternate key type.
Remarks
Writes made through the lookup do not count towards .
GetEnumerator()
Returns an enumerator over the parameters.
public Dictionary<string, T>.Enumerator GetEnumerator()Returns
Dictionary<string, T>.Enumerator
Remove(string)
Removes a parameter. Counts as a change when one was removed.
public bool Remove(string key)Parameters
key string
Returns
TryGetValue(string, out T)
Gets the value that is associated with the specified key.
public bool TryGetValue(string key, out T value)Parameters
key string
The key to locate.
value T
When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.
Returns
true if the object that implements the interface contains an element that has the specified key; otherwise, false.
Exceptions
key is null.

