Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.3 KB

File metadata and controls

21 lines (16 loc) · 1.3 KB

ModuleConstraint Class

The base type for all WFC constraints. Feel free to subclass this type and make your own constraints.

public abstract class ModuleConstraint

Inheritance System.Object 🡒 ModuleConstraint

Derived
AdjacencyConstraint

Methods


ShouldRemoveModule(SlotEdge, GenerationSpace, Module, ModuleSet)

The only required method of a WFC constraint.
Given some edge and some module-in-question, should the module-in-question be removed from the edge's source's possibility space?

When the WFC algorithm propagates information, every possible module per slot is checked against every neighboring slot. If ANY neighboring slot has a constraint that disqualifies the module-in-question, the module will be removed from the source's superposition. This in turn, causes a new propagation wave.