Class ProductAttributes
A product's attributes, indexed once by attribute number (ordinal comparison).
Inheritance
ProductAttributes
Assembly: Activout.Blue5.dll
Syntax
public sealed class ProductAttributes : IReadOnlyCollection<ProductAttribute>, IEnumerable<ProductAttribute>, IEnumerable
Constructors
|
Edit this page
View Source
ProductAttributes(IEnumerable<ProductAttribute>)
Indexes attributes by number. If a number repeats, the first one wins for lookups.
Declaration
public ProductAttributes(IEnumerable<ProductAttribute> attributes)
Parameters
Fields
|
Edit this page
View Source
Empty
Declaration
public static readonly ProductAttributes Empty
Field Value
Properties
|
Edit this page
View Source
Count
Declaration
public int Count { get; }
Property Value
Methods
|
Edit this page
View Source
Contains(string)
Whether the product has an attribute with the given number.
Declaration
public bool Contains(string number)
Parameters
| Type |
Name |
Description |
| string |
number |
|
Returns
|
Edit this page
View Source
Find(string)
The raw attribute with the given number, or null.
Declaration
public ProductAttribute? Find(string number)
Parameters
| Type |
Name |
Description |
| string |
number |
|
Returns
|
Edit this page
View Source
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<ProductAttribute> GetEnumerator()
Returns
|
Edit this page
View Source
Get<T>(AttributeKey<T>)
Returns the attribute value converted to T, or DefaultValue
when the product has no value for it.
Declaration
public T Get<T>(AttributeKey<T> key)
Parameters
Returns
Type Parameters
Exceptions
Implements