protected WaitForMultipleEvents(Coroutine coroutine, Event[] requests, double seconds, params Event[] e) { this.coroutine = coroutine; if (!Object.ReferenceEquals(requests, null)) { waitHandle = WaitHandlePool.Acquire(); for (int i = 0, count = requests.Length; i < count; ++i) { requests[i]._WaitHandle = waitHandle; } for (int i = 0, count = e.Length; i < count; ++i) { e[i]._WaitHandle = waitHandle; } } expected = e; actual = new Event[expected.Length]; handlerTokens = new Binder.Token[expected.Length]; for (int i = 0; i < expected.Length; ++i) { handlerTokens[i] = Flow.Bind(expected[i], OnEvent); } if (seconds > 0) { TimeoutEvent timeoutEvent = new TimeoutEvent { Key = this }; timeoutToken = Flow.Bind(timeoutEvent, OnTimeout); timerToken = TimeFlow.Default.Reserve(timeoutEvent, seconds); } }
public WaitForSeconds(Coroutine coroutine, double seconds) { this.coroutine = coroutine; TimeoutEvent e = new TimeoutEvent { Key = this }; token = Flow.Bind(e, OnTimeout); TimeFlow.Default.Reserve(e, seconds); }
public WaitForNothing(Coroutine coroutine, object result) { this.coroutine = coroutine; this.result = result; TimeoutEvent e = new TimeoutEvent { Key = this }; token = Flow.Bind(e, OnTimeout); Hub.Post(e); }
public WaitForMultipleEvents(Coroutine coroutine, params Event[] e) { this.coroutine = coroutine; expected = e; actual = new Event[expected.Length]; for (int i = 0; i < expected.Length; ++i) { Flow.Bind(expected[i], OnEvent); } }
public WaitForSingleEvent(Coroutine coroutine, Event e, double seconds) { this.coroutine = coroutine; handlerToken = Flow.Bind(e, OnEvent); if (seconds >= 0) { TimeoutEvent timeoutEvent = new TimeoutEvent { Key = this }; timeoutToken = Flow.Bind(timeoutEvent, OnTimeout); timerToken = TimeFlow.Default.Reserve(timeoutEvent, seconds); } }
protected WaitForSingleEvent(Coroutine coroutine, Event request, Event e, double seconds) { this.coroutine = coroutine; if (!Object.ReferenceEquals(request, null)) { int waitHandle = WaitHandlePool.Acquire(); request._WaitHandle = waitHandle; e._WaitHandle = waitHandle; } handlerToken = Flow.Bind(e, OnEvent); if (seconds > 0) { TimeoutEvent timeoutEvent = new TimeoutEvent { Key = this }; timeoutToken = Flow.Bind(timeoutEvent, OnTimeout); timerToken = TimeFlow.Default.Reserve(timeoutEvent, seconds); } }
public WaitForSingleEvent(Coroutine coroutine, Event e) : this(coroutine, null, e, Config.Coroutine.DefaultTimeout) { }
public WaitForSingleResponse(Coroutine coroutine, Event request, Event response) : this(coroutine, request, response, Config.Coroutine.DefaultTimeout) { }
public WaitForSingleResponse(Coroutine coroutine, Event request, Event response, double seconds) : base(coroutine, request, response, seconds) { if (Object.ReferenceEquals(request, null)) { throw new ArgumentNullException(); } request.Post(); }
public WaitForSingleResponse(Coroutine coroutine, Event request, Event response) : base(coroutine, response) { request.Post(); }
public WaitForCompletion(Coroutine coroutine, Func<Coroutine, IEnumerator> func) { Coroutine c = new Coroutine(coroutine); c.Start(func(c)); }
public WaitForSingleEvent(Coroutine coroutine, Event e) : this(coroutine, e, 30.0) { }
public WaitForMultipleEvents(Coroutine coroutine, params Event[] e) : this(coroutine, null, Config.Coroutine.DefaultTimeout, e) { }
public WaitForMultipleResponses(Coroutine coroutine, Event[] requests, double seconds, params Event[] responses) : base(coroutine, requests, seconds, responses) { if (Object.ReferenceEquals(requests, null)) { throw new ArgumentNullException(); } for (int i = 0; i < requests.Length; ++i) { requests[i].Post(); } }
public WaitForSingleEvent(Coroutine coroutine, Event e, double seconds) : this(coroutine, null, e, seconds) { }
public WaitForMultipleResponses(Coroutine coroutine, Event[] requests, params Event[] responses) : base(coroutine, responses) { for (int i = 0; i < requests.Length; ++i) { requests[i].Post(); } }
public WaitForMultipleEvents(Coroutine coroutine, double seconds, params Event[] e) : this(coroutine, null, seconds, e) { }
public WaitForNothing(Coroutine coroutine) : this(coroutine, null) { }
public WaitForSingleResponse(Coroutine coroutine, Event request, Event response, double seconds) : base(coroutine, response, seconds) { request.Post(); }
public WaitForMultipleResponses(Coroutine coroutine, Event[] requests, params Event[] responses) : this(coroutine, requests, Config.Coroutine.DefaultTimeout, responses) { }