Class ParticleAttribute_Int
ParticleAttribute<T> subclass representing integer values.
Namespace: AS2.Sim
Assembly: .dll
Syntax
public class ParticleAttribute_Int : ParticleAttributeWithHistory<int>, IParticleAttribute, IReplayHistory
Constructors
| Edit this page View SourceParticleAttribute_Int(Particle, string, int)
Declaration
public ParticleAttribute_Int(Particle particle, string name, int value = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| Particle | particle | |
| string | name | |
| int | value |
Methods
| Edit this page View SourceEquals(ParticleAttribute<int>)
Indicates whether the current object is equal to another object of the same type.
Declaration
public override bool Equals(ParticleAttribute<int> other)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleAttribute<int> | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Overrides
| Edit this page View SourceGetCurrentValue()
Returns the latest value of this attribute.
The return value changes based on value assignments made within this activation. Use GetValue() to get the attribute's value at the beginning of the current round.
Declaration
public override int GetCurrentValue()
Returns
| Type | Description |
|---|---|
| int | The latest value of this attribute. |
Overrides
| Edit this page View SourceGetValue()
Returns the attribute's value from the snapshot taken at the beginning of the current round.
The return value is not changed by assigning new values to this attribute! To get the latest assigned value, use GetCurrentValue().
Declaration
public override int GetValue()
Returns
| Type | Description |
|---|---|
| int | The attribute value at the beginning of the current round. |
Overrides
| Edit this page View SourceSetValue(int)
Assigns the given value to this attribute.
Note that this value will only be visible to other particles in the next round.
Declaration
public override void SetValue(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The new value assigned to this attribute. |
Overrides
| Edit this page View SourceToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
ToString_AttributeValue()
String representation of the attribute's current value.
Declaration
public 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
public bool UpdateAttributeValue(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | String representation of the new value. |
Returns
| Type | Description |
|---|---|
| bool |
|