Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 1.78 KB

GenerationSpace_TryGetOnlyOption(Slot_Module).md

File metadata and controls

24 lines (21 loc) · 1.78 KB

GenerationSpace.TryGetOnlyOption(Slot, Module) Method

At any given moment, a slot may have many possible modules available to it. However, eventually, a slot will only have one possible module remaining.
This method will help you identify when there is only one module left per slot.
If there is only one module left for the given slot, this method will return true and store the assigned module in the out parameter. If there is more than one module possible, the method will return false, and the out variable will be null.

You can also retrieve all of the available slot modules with the GenerationSpace.GetSlotOptions method.
GetSlotOptions(Slot)

public bool TryGetOnlyOption(BrewedInk.WFC.Slot slot, out BrewedInk.WFC.Module module);

Parameters

slot Slot
The slot whose only remaining available module will be checked.

module Module
An out variable for the only remaining available module. After the method is invoked, the value of the module will be the last module for the slot, or null if there are more than one modules remaining.

Returns

System.Boolean
true if there was only one module available, or false otherwise.