Class ParallelogramTestInitializer
Namespace: AS2.Algos.SuboracleTest
Assembly: .dll
Syntax
public class ParallelogramTestInitializer : InitializationMethod
Constructors
| Edit this page View SourceParallelogramTestInitializer(ParticleSystem)
Declaration
public ParallelogramTestInitializer(ParticleSystem system)
Parameters
| Type | Name | Description |
|---|---|---|
| ParticleSystem | system |
Methods
| Edit this page View SourceGenerate(CardinalDirection, int, int, bool)
Declaration
public void Generate(ParallelogramTestInitializer.CardinalDirection startDir = CardinalDirection.NNE, int firstLineLength = 10, int secondLineLength = 10, bool surround = false)
Parameters
| Type | Name | Description |
|---|---|---|
| ParallelogramTestInitializer.CardinalDirection | startDir | |
| int | firstLineLength | |
| int | secondLineLength | |
| bool | surround |
GenerateParallelogram(Vector2Int, int, Direction, int, int, bool)
Helper function to generate the positions of a parallelogram with two occupied sides based on the given parameters. Has the ability to fill the missing sides to create a full parallelogram shape. Has two modes: if the length parameters are set to 0, it generates a random parallelogram with the given maximum number of particles, otherwise it generates a parallelogram with the given side lengths.
Declaration
public (List<Vector2Int>, Vector2Int) GenerateParallelogram(Vector2Int startPos, int maxParticles, Direction startDir, int firstLineLength, int secondLineLength, bool fill = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2Int | startPos | The starting position of the parallelogram. |
| int | maxParticles | The maximum number of particles to use. |
| Direction | startDir | The direction of the first line of the parallelogram. |
| int | firstLineLength | The length of the first line. |
| int | secondLineLength | The length of the second line. |
| bool | fill | Whether to fill the missing sides. |
Returns
| Type | Description |
|---|---|
| (List<Vector2Int>, Vector2Int) | A tuple containing the list of positions and the dimensions of the parallelogram. |