Interface IParticleAttribute
Interface defining how particle attributes can be used by the System and the UI.
Namespace: AS2.Sim
Assembly: .dll
Syntax
public interface IParticleAttribute : IReplayHistory
Methods
| Edit this page View SourceGenerateSaveData()
Returns a serializable object representing the attribute's data.
Declaration
ParticleAttributeSaveDataBase GenerateSaveData()
Returns
Type | Description |
---|---|
ParticleAttributeSaveDataBase | An instance of a subclass of ParticleAttributeSaveDataBase matching the attribute's type. |
GetAttributeType()
Returns the type of the attribute's value.
Declaration
Type GetAttributeType()
Returns
Type | Description |
---|---|
Type | The type of value stored in the attribute. |
GetObjectValue()
Returns the attribute's current value as an object.
Declaration
object GetObjectValue()
Returns
Type | Description |
---|---|
object | The attribute's current value. |
ResetIntermediateValue()
Resets the attribute's intermediate value state. Must be called after each simulated round.
Intermediate values are used to keep a value written during the movement phase available in the beep phase. This is necessary because a simulation round contains two activations and an attribute value can change in each of the phases.
Declaration
void ResetIntermediateValue()
RestoreFromSaveData(ParticleAttributeSaveDataBase)
Loads the attribute data from the given serializable object and resets this attribute to the state encoded in that data.
Declaration
bool RestoreFromSaveData(ParticleAttributeSaveDataBase data)
Parameters
Type | Name | Description |
---|---|---|
ParticleAttributeSaveDataBase | data | A serializable representation of a particle attribute state. |
Returns
Type | Description |
---|---|
bool |
|
SetRandomValue()
Sets the attribute's value to a random value if the attribute type allows this.
Declaration
bool SetRandomValue()
Returns
Type | Description |
---|---|
bool |
|
ToString()
String representation of the attribute and its current state.
Declaration
string ToString()
Returns
Type | Description |
---|---|
string | A string containing the attribute's type, its display name, and its current value. |
ToString_AttributeName()
The attribute's name to be displayed in the UI.
Declaration
string ToString_AttributeName()
Returns
Type | Description |
---|---|
string | The attribute's display name. |
ToString_AttributeValue()
String representation of the attribute's current value.
Declaration
string ToString_AttributeValue()
Returns
Type | Description |
---|---|
string | A string containing the attribute's current value. |
UpdateAttributeValue(string)
Updates the attribute's value to the one represented by the given string.
Declaration
bool UpdateAttributeValue(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | String representation of the new value. |
Returns
Type | Description |
---|---|
bool |
|