27 throw new BadRuntimeException(
"Task constructor takes 2 arguments");
52 private readonly Dictionary<string, BadObjectReference>
m_Properties =
53 new Dictionary<string, BadObjectReference>();
85 "Task.RunSynchronously",
117 public string Name {
get;
set; }
165 IEnumerator<BadObject> e = runnable.
Enumerator;
168 yield
return e.Current ??
Null;
304 StringBuilder sb =
new StringBuilder();
307 foreach (KeyValuePair<string, BadObjectReference> props
in m_Properties)
309 sb.AppendLine($
"\t{props.Key}: {props.Value.Dereference()}");
314 return sb.ToString();
327 base.HasProperty(propName, caller);
Implements a Runnable Object.
static BadRunnable Create(IEnumerable< BadObject > e)
Creates a Runnable from an Enumeration.
IEnumerator< BadObject > Enumerator
The Enumerator of the Runnable.
Implements a Task Object.
void Resume()
Resumes the Task.
void SetCreator(BadTask? task)
Sets the Creator of this Task.
BadTask(BadRunnable runnable, string name)
Constructs a new Task.
void AddContinuation(BadTask task)
Adds a Continuation Task.
bool IsPaused
Is true if the task is running.
static BadTask Create(BadFunction f, BadExecutionContext caller, string? name, params BadObject[] args)
Creates a new Task from a Function.
override bool HasProperty(string propName, BadScope? caller=null)
Returns true if the object contains a given property or there exists an extension for the current Ins...
void Start()
Starts the Task.
override string ToSafeString(List< BadObject > done)
IEnumerable< BadObject > Enumerate(BadRunnable runnable)
bool IsInactive
Is True if the Task is not running, finished or paused.
void Run(BadExecutionContext context)
override BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.The Property Reference
void Pause()
Pauses the Task.
static readonly BadClassPrototype Prototype
The BadTask Prototype.
BadTask? Creator
The Creator of this Task.
BadObject ContinueWith(BadTask task)
Continues the Task with another Task.
bool IsFinished
Is true if the task is finished.
IEnumerable< BadTask > ContinuationTasks
Enumeration of Continuation Tasks.
void Cancel()
Cancels the Task.
readonly Dictionary< string, BadObjectReference > m_Properties
The Task Properties.
readonly List< BadTask > m_ContinuationTasks
The List of Continuation Tasks.
void Stop()
Stops the Task.
string Name
The Name of the Task.
bool IsRunning
Is true if the task is running.
override BadClassPrototype GetPrototype()
BadRunnable Runnable
Runnable of the Task.
The BadScript Task Runner.
void AddTask(BadTask task, bool runImmediately=false)
Adds a Task to the Task Runner.
bool IsTaskAdded(BadTask task)
Checks if a Task is added to the Task Runner.
The Execution Context. Every execution of a script needs a context the script is running in....
BadScope Scope
The Root Scope of the Context.
Implements the Scope for the Script Engine.
Gets thrown by the runtime.
static BadRuntimeException Create(BadScope? scope, string message)
Creates a new BadScriptException.
Non Generic Interop Function.
Interop Function taking an array of arguments.
The Base Class for all BadScript Objects.
override string ToString()
Returns a String Representation of this Object.
virtual BadObjectReference GetProperty(string propName, BadScope? caller=null)
Returns a Reference to the Property with the given Name.
static readonly BadObject Null
The Null Value for the BadScript Language.
Implements the base functionality for a BadScript Reference.
static BadObjectReference Make(string refText, Func< BadObject > getter, Action< BadObject, BadPropertyInfo?>? setter=null, Action? delete=null)
Creates a new Reference Object.
Implements a function that can be called from the script.
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.
Implements a Class Prototype for the BadScript Language.
Implements a Native Class Prototype.
Implements the Interface for Native Strings.
new string Value
The String Value.
Contains task/async Extensions and Integrations for the BadScript2 Runtime.
Contains the Error Objects for the BadScript2 Language.
Contains the Interop Function Classes for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Native Runtime Objects.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.