Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 4.28 KB

File metadata and controls

52 lines (35 loc) · 4.28 KB

WFCProgressObserver Class

A wrapper class around the invocation of a WFC collapse operation.
You should use this in conjunction with RunAsCoroutine(IEnumerable<WFCProgress>, MonoBehaviour, float)

public class WFCProgressObserver

Inheritance System.Object 🡒 WFCProgressObserver

Properties


IsComplete

Returns true when the operation is complete. This will be true the instant BEFORE the onComplete callbacks are invoked.


ProgressCount

The number of progress events received for this operation. There isn't a knowable upper bound, but you can use this to track that progress is happening.


SlotSelections

A set of selections you can use inspect to see what has finished. If you want an event driven approach, use OnSelectedModule(Action<SlotModuleSelected>)

Methods


OnCompleted(Action)

A callback that executes when the WFC operation has completed. This happens right after the WFCProgressObserver.OnComplete is set to true.


OnProgress(Action<WFCProgress>)

A callback that executes anytime the WFC has new progress. Progress elements can represent a module being removed, or a module being selected, an error, or a general propagation of data.


OnSelectedModule(Action<Slot,Module>)

A callback that executes anytime a slot collapses to a single module possibility. This is a type of WFCProgress, and will execute right after the OnProgress(Action<WFCProgress>) callbacks


OnSelectedModule(Action<SlotModuleSelected>)

A callback that executes anytime a slot collapses to a single module possibility. This is a type of WFCProgress, and will execute right after the OnProgress(Action<WFCProgress>) callbacks


OnSelectedModule<TModule>(Action<Slot,TModule>)

A callback that executes anytime a slot collapses to a single module possibility. This is a type of WFCProgress, and will execute right after the OnProgress(Action<WFCProgress>) callbacks