DefaultValueMetadata Class
Namespace: Stride.CoreAssembly: Stride.Core.dll
Abstract class that could be overloaded in order to define how to get default value of an PropertyKey.
public abstract class DefaultValueMetadata : PropertyKeyMetadata
| Name | Description | |
|---|---|---|
| Properties | ||
| KeepValue | Gets a value indicating whether this value is kept. |
|
| PropertyUpdateCallback | Gets or sets the property update callback. |
|
| Methods | ||
| Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback) | ||
| GetDefaultValue(ref PropertyContainer) | Gets the default value of an external property, and specify if this default value should be kept. It could be usefull with properties with default values depending of its container, especially if they are long to generate. An example would be collision data, which should be generated only once. |
|
| Static<T>(T, Boolean) | ||
Properties
KeepValue
Gets a value indicating whether this value is kept.
public virtual bool KeepValue { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
PropertyUpdateCallback
Gets or sets the property update callback.
public PropertyContainer.PropertyUpdatedDelegate PropertyUpdateCallback { get; set; }
Property Value
| Type | Description |
|---|---|
| PropertyContainer.PropertyUpdatedDelegate | The property update callback. |
Methods
Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback)
public static DelegateDefaultValueMetadata<T> Delegate<T>(DelegateDefaultValueMetadata<T>.DefaultValueCallback callback)
Parameters
| Type | Name | Description |
|---|---|---|
| DelegateDefaultValueMetadata.DefaultValueCallback<> | callback |
Returns
| Type | Description |
|---|---|
| DelegateDefaultValueMetadata<T> |
Type Parameters
| Name | Description |
|---|---|
| T |
GetDefaultValue(ref PropertyContainer)
Gets the default value of an external property, and specify if this default value should be kept. It could be usefull with properties with default values depending of its container, especially if they are long to generate. An example would be collision data, which should be generated only once.
public abstract object GetDefaultValue(ref PropertyContainer obj)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyContainer | obj | The property container. |
Returns
| Type | Description |
|---|---|
| System.Object | The default value. |
Static<T>(T, Boolean)
public static StaticDefaultValueMetadata<T> Static<T>(T defaultValue, bool keepDefaultValue = false)
Parameters
| Type | Name | Description |
|---|---|---|
| T | defaultValue | |
| System.Boolean | keepDefaultValue |
Returns
| Type | Description |
|---|---|
| StaticDefaultValueMetadata<T> |
Type Parameters
| Name | Description |
|---|---|
| T |