Interface IParticleState
Implemented by the particles. Contains helpful methods for the view to access standardized data from particles.
Namespace: AS2.Visuals
Assembly: .dll
Syntax
public interface IParticleState
Methods
| Edit this page View SourceAlgorithmName()
Gets the name of the algorithm running this particle's behavior.
Declaration
string AlgorithmName()
Returns
| Type | Description |
|---|---|
| string | The unique display name of the algorithm running this particle. |
Chirality()
Returns the chirality of the particle. true means
counter-clockwise and false means clockwise.
Declaration
bool Chirality()
Returns
| Type | Description |
|---|---|
| bool | The chirality of the particle. |
CompassDir()
Returns the global compass orientation of the particle. This is the global direction that the particle identifies as E in its local view.
Declaration
Direction CompassDir()
Returns
| Type | Description |
|---|---|
| Direction | The global compass orientation of the particle. |
GetAttributes()
Returns a list of all ParticleAttribute<T>s of the particle.
Declaration
List<IParticleAttribute> GetAttributes()
Returns
| Type | Description |
|---|---|
| List<IParticleAttribute> | A list containing all attributes of the particle. |
GetCircuitPinsPerSide()
Returns the number of pins per side at the particle.
Declaration
int GetCircuitPinsPerSide()
Returns
| Type | Description |
|---|---|
| int |
GetGraphicsAdapter()
Returns the graphics adapter for the particle.
Declaration
IParticleGraphicsAdapter GetGraphicsAdapter()
Returns
| Type | Description |
|---|---|
| IParticleGraphicsAdapter |
GetParticleColor()
Method to get the particle color for the visualization.
Declaration
Color GetParticleColor()
Returns
| Type | Description |
|---|---|
| Color |
GlobalHeadDirectionInt()
The global direction of an expansion. Returns -1 if there is no expansion.
Declaration
int GlobalHeadDirectionInt()
Returns
| Type | Description |
|---|---|
| int |
Head()
Head position of the particle.
Declaration
Vector2Int Head()
Returns
| Type | Description |
|---|---|
| Vector2Int |
IsAnchor()
Checks if the particle is currently the anchor of the system. The anchor particle defines how the system moves during a joint movement by keeping its global position.
Declaration
bool IsAnchor()
Returns
| Type | Description |
|---|---|
| bool |
|
IsExpanded()
True if the particle is expanded, false if not.
Declaration
bool IsExpanded()
Returns
| Type | Description |
|---|---|
| bool |
IsParticleColorSet()
Checks if the particle color has been overwritten.
Declaration
bool IsParticleColorSet()
Returns
| Type | Description |
|---|---|
| bool |
|
MakeAnchor()
Turns this particle into the anchor of the system. The anchor particle defines how the system moves during a joint movement by keeping its global position.
Declaration
bool MakeAnchor()
Returns
| Type | Description |
|---|---|
| bool |
|
SetChirality(bool)
Sets the particle's chirality to the given value. Only works if the particle is in a state that allows the chirality to be set.
Declaration
void SetChirality(bool chirality)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | chirality | The new chirality. |
SetChiralityRandom()
Sets the particle's chirality to a random value. Only works if the particle is in a state that allows the chirality to be set.
Declaration
void SetChiralityRandom()
SetCompassDir(Direction)
Sets the particle's compass direction to the given value. Only works if the particle is in a state that allows the compass to be set.
Declaration
void SetCompassDir(Direction compassDir)
Parameters
| Type | Name | Description |
|---|---|---|
| Direction | compassDir | The new compass direction, given as a global cardinal direction. |
SetCompassDirRandom()
Sets the particle's compass direction to a random value. Only works if the particle is in a state that allows the compass to be set.
Declaration
void SetCompassDirRandom()
Tail()
Tail position of the particle. Same as Head() if the particle is not expanded.
Declaration
Vector2Int Tail()
Returns
| Type | Description |
|---|---|
| Vector2Int |
TryGetAttributeByName(string)
Provides access to ParticleAttribute<T>s by their display names.
Declaration
IParticleAttribute TryGetAttributeByName(string attrName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | attrName | The display of the attribute to return. |
Returns
| Type | Description |
|---|---|
| IParticleAttribute | The particle's attribute with the given name |