Empeld
Empeld plugin documentation.
pluginbase.Objects.Tasks.YieldingTask Class Reference

Uses static yield-types to schedule something if IEnumerable<ITaskYieldAction> for inline code More...

Inheritance diagram for pluginbase.Objects.Tasks.YieldingTask:
pluginbase.Objects.Tasks.ITask

Public Member Functions

 YieldingTask (Func< IEnumerable< ITaskYieldAction >> method, TimeSpan delay)
 
 YieldingTask (Func< IEnumerable< ITaskYieldAction >> method)
 

Static Public Member Functions

static ITaskYieldAction Task (ITask task)
 Yield a new task to run here More...
 
static ITaskYieldAction Task (Func< IEnumerable< ITaskYieldAction >> task)
 Yield a new task to run here More...
 
static ITaskYieldAction Wait (Func< bool > predicate, TimeSpan checkTime)
 Wait until the predicate is true, checking every amount of time More...
 
static ITaskYieldAction Wait (TimeSpan time)
 Wait the specified time More...
 
static ITaskYieldAction Wait (Func< bool > predicate)
 Wait for the predicate to be true More...
 
static ITaskYieldAction Wait (double seconds)
 Wait the specified number of seconds More...
 

Properties

static ITaskYieldAction Next [get]
 Yields to the next scheduled task. Will start again in the next tick More...
 
static ITaskYieldAction Reset [get]
 Restarts the task over from the beginning More...
 
- Properties inherited from pluginbase.Objects.Tasks.ITask
TimeSpan Frequency [get]
 

Detailed Description

Uses static yield-types to schedule something if IEnumerable<ITaskYieldAction> for inline code

Constructor & Destructor Documentation

◆ YieldingTask() [1/2]

pluginbase.Objects.Tasks.YieldingTask.YieldingTask ( Func< IEnumerable< ITaskYieldAction >>  method,
TimeSpan  delay 
)
19  {
20  _method = method;
21  _iter = method().GetEnumerator();
22  _frequency = delay;
23  }

◆ YieldingTask() [2/2]

pluginbase.Objects.Tasks.YieldingTask.YieldingTask ( Func< IEnumerable< ITaskYieldAction >>  method)
26  :this(method, TimeSpan.Zero)
27  { }

Member Function Documentation

◆ Task() [1/2]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Task ( ITask  task)
static

Yield a new task to run here

Parameters
taskTask.
124  {
125  return new YieldTask(task);
126  }

◆ Task() [2/2]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Task ( Func< IEnumerable< ITaskYieldAction >>  task)
static

Yield a new task to run here

Parameters
taskTask.
133  {
134  return new YieldTask(new YieldingTask(task));
135  }
YieldingTask(Func< IEnumerable< ITaskYieldAction >> method, TimeSpan delay)
Definition: YieldingTask.cs:18

◆ Wait() [1/4]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Wait ( Func< bool >  predicate,
TimeSpan  checkTime 
)
static

Wait until the predicate is true, checking every amount of time

Parameters
predicatePredicate.
checkTimeCheck time.
143  {
144  return new YieldWait(predicate, checkTime);
145  }

◆ Wait() [2/4]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Wait ( TimeSpan  time)
static

Wait the specified time

Parameters
timeTime.
152  {
153  return new YieldWait(time);
154  }

◆ Wait() [3/4]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Wait ( Func< bool >  predicate)
static

Wait for the predicate to be true

Parameters
predicatePredicate.
161  {
162  return new YieldWait(predicate, TimeSpan.FromSeconds(0.5));
163  }

◆ Wait() [4/4]

static ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Wait ( double  seconds)
static

Wait the specified number of seconds

Parameters
secondsSeconds.
170  {
171  return new YieldWait(TimeSpan.FromSeconds(seconds));
172  }

Property Documentation

◆ Next

ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Next
staticget

Yields to the next scheduled task. Will start again in the next tick

◆ Reset

ITaskYieldAction pluginbase.Objects.Tasks.YieldingTask.Reset
staticget

Restarts the task over from the beginning

The reset.


The documentation for this class was generated from the following file: