public static Coroutine StartCoroutine(this MonoBehaviour behaviour, CoroutineMethod method)
        {
            if (behaviour == null) throw new System.ArgumentNullException("behaviour");
            if (method == null) throw new System.ArgumentNullException("method");

            return behaviour.StartCoroutine(method());
        }
Beispiel #2
0
 public SymbolStringTuple(int result, string str, CoroutineMethod coroutineName, bool ignorable = false)
 {
     this.result        = result;
     this.str           = str;
     this.coroutineName = coroutineName;
     this.ignorable     = ignorable;
 }
Beispiel #3
0
 /// <summary>
 /// Create a processed token for a Terminal
 /// </summary>
 /// <param name="tokenSymbol"></param>
 /// <param name="rule"></param>
 /// <param name="rhs"></param>
 public ProcessedToken(int tokenSymbolLocation, CoroutineMethod rule, object data)
 {
     this.rhs                 = null;
     this.terminal            = true;
     this.tokenSymbolLocation = tokenSymbolLocation;
     this.rule                = rule;
     this.data                = data;
 }
Beispiel #4
0
 /// <summary>
 /// Create a processed token for a NonTerminal
 /// </summary>
 /// <param name="tokenSymbol"></param>
 /// <param name="rule"></param>
 /// <param name="rhs"></param>
 public ProcessedToken(int tokenSymbolLocation, CoroutineMethod rule, List <ProcessedToken> rhs)
 {
     this.rhs                 = rhs;
     this.terminal            = false;
     this.tokenSymbolLocation = tokenSymbolLocation;
     this.rule                = rule;
     this.data                = null;
 }
 public void CoroutineRunner(CoroutineMethod toBeRun)
 {
     StartCoroutine(toBeRun());
 }
Beispiel #6
0
 public Coroutine(CoroutineMethod coroutineMethod, string coroutineName)
 {
     Method = coroutineMethod;
     Name   = coroutineName;
 }
        public static RadicalCoroutine StartRadicalCoroutine(this MonoBehaviour behaviour, CoroutineMethod method)
        {
            if (behaviour == null) throw new System.ArgumentNullException("behaviour");
            if (method == null) throw new System.ArgumentNullException("routine");

            var co = new RadicalCoroutine(method().GetEnumerator());
            co.Start(behaviour);
            return co;
        }
        public RadicalCoroutine Schedule(MonoBehaviour behaviour, CoroutineMethod routine, RadicalCoroutineDisableMode disableMode = RadicalCoroutineDisableMode.Default)
        {
            if (behaviour == null) throw new System.ArgumentNullException("behaviour");
            if (routine == null) throw new System.ArgumentNullException("routine");

            var co = new RadicalCoroutine(routine().GetEnumerator());
            this.OnComplete += (s, e) =>
            {
                if (co._state == RadicalCoroutineOperatingState.Inactive) co.Start(behaviour, disableMode);
            };
            return co;
        }
        public RadicalCoroutine StartRadicalCoroutine(CoroutineMethod routine, RadicalCoroutineDisableMode disableMode = RadicalCoroutineDisableMode.Default)
        {
            if (routine == null) throw new System.ArgumentNullException("routine");

            var co = new RadicalCoroutine(routine().GetEnumerator());
            co.Start(this, disableMode);
            return co;
        }
Beispiel #10
0
 /// <summary>
 /// Runs a coroutine sent from
 /// a non-mono behavior
 /// </summary>
 /// <param name="coroutineMethod"></param>
 /// <returns></returns>
 IEnumerator RunCoroutine(CoroutineMethod coroutineMethod)
 {
     return(coroutineMethod());
 }
Beispiel #11
0
 public ProductionRule(int result, int rhsSize, CoroutineMethod coroutineName)
 {
     this.result        = result;
     this.rhsSize       = rhsSize;
     this.coroutineName = coroutineName;
 }
 IEnumerator RunCoroutine(CoroutineMethod _method)
 {
     return _method();
 }
 public Coroutine StartCoroutineDelegate(CoroutineMethod _method)
 {
     return StartCoroutine("RunCoroutine", _method);
 }
Beispiel #14
0
 public IEnumerator RunCoroutine(CoroutineMethod method)
 {
     return(method());
 }
Beispiel #15
0
 public void StartCoroutineDelegate(CoroutineMethod method)
 {
     StartCoroutine("RunCoroutine", method);
 }