Class SeparationConstraint
This constriant forces particular tiles to not be placed near each other. It's useful for giving a more even distribution of tiles, similar to a Poisson disk sampling.
Implements
Namespace: DeBroglie.Constraints
Assembly: DeBroglie.dll
Syntax
public class SeparationConstraint : ITileConstraint
Properties
| Edit this page View SourceMinDistance
The minimum distance between two points. Measured using manhattan distance.
Declaration
public int MinDistance { get; set; }
Property Value
Type | Description |
---|---|
int |
Tiles
Set of tiles, all of which should be separated from each other.
Declaration
public ISet<Tile> Tiles { get; set; }
Property Value
Type | Description |
---|---|
ISet<Tile> |
Methods
| Edit this page View SourceCheck(TilePropagator)
Called frequently during generation to help maintain the constraint.
Declaration
public void Check(TilePropagator propagator)
Parameters
Type | Name | Description |
---|---|---|
TilePropagator | propagator | The propagator to constrain |
Init(TilePropagator)
Called once when the propagator first initializes.
Declaration
public void Init(TilePropagator propagator)
Parameters
Type | Name | Description |
---|---|---|
TilePropagator | propagator | The propagator to constrain |