private void CreateSubRoutineForVal(object val)
 {
     _subroutine = _yieldInstructionFactory.CreateYieldInstructionWrapper(val);
     if (_subroutine != null && !_subroutine.HasUpdater)
     {
         _subroutine.RegisterUpdater(this);
     }
 }
예제 #2
0
        ICFunc AddFunction(ICFunc function)
        {
            if (_routines.Contains(function))
            {
                throw new AlreadyAddedCoroutineException();
            }

            function.RegisterUpdater(this);
            _routines.Add(function);
            return(function);
        }