Class CountConstraint
Enforces that the global count of tiles within a given set must be at most/least/equal to a given count
Implements
Namespace: DeBroglie.Constraints
Assembly: DeBroglie.dll
Syntax
public class CountConstraint : ITileConstraint
Properties
| Edit this page View SourceComparison
Declaration
public CountComparison Comparison { get; set; }
Property Value
Type | Description |
---|---|
CountComparison |
Count
The count to be compared against.
Declaration
public int Count { get; set; }
Property Value
Type | Description |
---|---|
int |
Eager
If set, this constraint will attempt to pick tiles as early as possible. This can give a better random distribution, but higher chance of contradictions.
Declaration
public bool Eager { get; set; }
Property Value
Type | Description |
---|---|
bool |
Tiles
The set of tiles to count
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 |