# Class: ComponentBlueprint<T>
Stores the name of a component and key/value pairs to construct the component.
see
EntityFactory
# Type parameters
Name | Type | Description |
---|---|---|
T | any | The blueprint interface. |
# Table of contents
# Constructors
# Properties
# Methods
# Constructors
# constructor
• new ComponentBlueprint<T
>(name
, defaultValues
)
Creates a new blueprint with the specified component name.
# Type parameters
Name | Type |
---|---|
T | any |
# Parameters
Name | Type | Description |
---|---|---|
name | string | The name of the component. |
defaultValues | T | The default values to use. |
# Defined in
src/factory/ComponentBlueprint.ts:23 (opens new window)
# Properties
# name
• Readonly
name: string
The name of this blueprint.
# Defined in
src/factory/ComponentBlueprint.ts:11 (opens new window)
# Methods
# get
▸ get<TKey
>(key
, fallback
): Exclude
<T
[TKey
], undefined
>
Get a value.
# Type parameters
Name | Type | Description |
---|---|---|
TKey | extends string | The type of key, do not specify manually! |
# Parameters
Name | Type | Description |
---|---|---|
key | TKey | The key. |
fallback | Exclude <T [TKey ], undefined > | The value to return if no default value and no override value exists for the key. |
# Returns
Exclude
<T
[TKey
], undefined
>
The corresponding value from overrides, defaultValues or the fallback parameter (in that order).
# Defined in
src/factory/ComponentBlueprint.ts:45 (opens new window)
# setOverrides
▸ Protected
setOverrides(overrides?
): void
Set the overrides map.
# Parameters
Name | Type | Description |
---|---|---|
overrides? | Partial <T > | The overrides to use on the next get* calls. |
# Returns
void