Struct AttributeMap
Defines a container that facilitates quick type-based attribute lookups.
Inherited Members
Namespace: Flame
Assembly: Flame.dll
Syntax
public struct AttributeMap
Constructors
| Improve this Doc View SourceAttributeMap(AttributeMapBuilder)
Creates this attribute map as a read-only view of an attribute map builder.
Declaration
public AttributeMap(AttributeMapBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
AttributeMapBuilder | builder | An attribute map builder to create a read-only view of. |
AttributeMap(IAttribute[])
Creates a new attribute map from a sequence of attributes.
Declaration
public AttributeMap(params IAttribute[] attributes)
Parameters
Type | Name | Description |
---|---|---|
IAttribute[] | attributes | A sequence of attributes to wrap in an attribute map. |
AttributeMap(IEnumerable<IAttribute>)
Creates a new attribute map from a sequence of attributes.
Declaration
public AttributeMap(IEnumerable<IAttribute> attributes)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IAttribute> | attributes | A sequence of attributes to wrap in an attribute map. |
Fields
| Improve this Doc View SourceEmpty
An empty attribute map.
Declaration
public static readonly AttributeMap Empty
Field Value
Type | Description |
---|---|
AttributeMap | An attribute map. |
Methods
| Improve this Doc View SourceContains(IType)
Checks if this attribute map contains at least one attribute of a particular type.
Declaration
public bool Contains(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | The type of attribute to look for. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetAll()
Gets all attributes in this attribute map.
Declaration
public IEnumerable<IAttribute> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IAttribute> | A sequence that contains all attributes in this attribute map. |
GetAll(IType)
Gets all attributes of a particular type in this attribute map.
Declaration
public IEnumerable<IAttribute> GetAll(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | The type of attribute to look for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IAttribute> | A sequence that contains all attributes of type |
GetOrNull(IType)
Finds the first attribute of a particular type. Returns null
if no such attribute exists.
Declaration
public IAttribute GetOrNull(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | The type of attribute to look for. |
Returns
Type | Description |
---|---|
IAttribute | An attribute of type |
TryGet(IType, out IAttribute)
Tries to find an attribute of a particular type.
Declaration
public bool TryGet(IType type, out IAttribute attribute)
Parameters
Type | Name | Description |
---|---|---|
IType | type | The type of attribute to look for. |
IAttribute | attribute | A variable to store the attribute in, if one is found. |
Returns
Type | Description |
---|---|
System.Boolean |
|