Interface ICustomPropertiesPerType<TValue>
Custom properties that you can attach to entities and can be used to get/set values during the game.
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface ICustomPropertiesPerType<TValue>
Type Parameters
| Name | Description |
|---|---|
| TValue |
Methods
| Improve this Doc View SourceAllProperties()
Returns a dictionary with all existing custom properties for this type.
Declaration
IDictionary<string, TValue> AllProperties()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IDictionary<System.String, TValue> | The properties. |
CopyFrom(ICustomPropertiesPerType<TValue>)
Copies the custom properties from a different object (this will override values in the current object, but will not delete properties which don't have an equivalent in the given object).
Declaration
void CopyFrom(ICustomPropertiesPerType<TValue> properties)
Parameters
| Type | Name | Description |
|---|---|---|
| ICustomPropertiesPerType<TValue> | properties | Properties. |
GetValue(String, TValue)
Gets the stored value for the custom property with the specified name. If no value is stored for this property, returns the specified default value instead (and stored that default value as the property's new value).
Declaration
TValue GetValue(string name, TValue defaultValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name. |
| TValue | defaultValue | Default value. |
Returns
| Type | Description |
|---|---|
| TValue | The value. |
SetValue(String, TValue)
Stores a new value for the custom property with the specified name. If an old value is stored it will be overridden by the new value.
Declaration
void SetValue(string name, TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name. |
| TValue | value | Value. |