Class TriangleTestInitializer
Namespace: AS2.Algos.SuboracleTest
Assembly: .dll
Syntax
public class TriangleTestInitializer : InitializationMethod
Constructors
| Edit this page View SourceTriangleTestInitializer(ParticleSystem)
Declaration
public TriangleTestInitializer(ParticleSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system |
Methods
| Edit this page View SourceGenerate(int, CardinalDirection, bool, bool, bool)
Declaration
public void Generate(int sideLength = 41, TriangleTestInitializer.CardinalDirection startDir = CardinalDirection.NNE, bool mirror = false, bool flipLegDir = false, bool surround = false)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sideLength | |
| TriangleTestInitializer.CardinalDirection | startDir | |
| bool | mirror | |
| bool | flipLegDir | |
| bool | surround |
GenerateTriangle(Vector2Int, int, Direction, bool, bool)
Helper function to generate the positions of the particles in the shape of a equilateral triangle with occupied legs but empty base. Has the option to fill the missing side to generate a full triangle
Declaration
public List<Vector2Int> GenerateTriangle(Vector2Int startPos, int sideLength, Direction startDir, bool mirrored, bool fill = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2Int | startPos | The starting position of the triangle |
| int | sideLength | The length of each side of the triangle |
| Direction | startDir | The direction of the first side |
| bool | mirrored | Whether the triangle is mirrored (starting with "right" leg) |
| bool | fill | Whether to fill the missing side |
Returns
| Type | Description |
|---|---|
| List<Vector2Int> | A list of positions representing the triangle |