// called when the state is changed. // for the step observer, it is called when the step is completed. public override void OnStateChange() { // Checklist cl = step.GetChecklist(); Checklist cl = step.checklist; // if the current step is set to the observer, then the step is complete. if (subject.GetStateNumber() == stepEndState && cl.GetCurrentStep() == step) { // the step has been completed. cl.CompleteStep(); } }