15 private readonly List<BadInteropApi>
m_Apis =
new List<BadInteropApi>();
20 private readonly List<BadInteropExtension>
m_Extensions =
new List<BadInteropExtension>();
43 IEnumerable<BadInteropApi> apis,
44 IEnumerable<BadInteropExtension> extensions) : this(apis)
117 int index =
m_Apis.FindIndex(x => x.Name == api.
Name);
133 public void AddApis(IEnumerable<BadInteropApi> apis)
150 if (ctx.Scope.HasLocal(api.
Name, ctx.Scope) && ctx.Scope.GetVariable(api.
Name).Dereference() is
BadTable t)
157 ctx.Scope.DefineVariable(api.
Name, table);
160 api.
Load(ctx, table);
165 ctx.Scope.DefineVariable(type.
Name, type);
The Execution Context. Every execution of a script needs a context the script is running in....
static BadExecutionContext Create(BadInteropExtensionProvider provider)
Creates a new Execution Context with an empty scope.
Provides settings for creating a new BadExecutionContext
BadExecutionContextOptions(IEnumerable< BadInteropApi > apis, IEnumerable< BadInteropExtension > extensions)
Creates a new instance of the BadExecutionContextOptions class.
void AddOrReplaceApis(IEnumerable< BadInteropApi > apis)
Adds or Replaces apis in the context.
BadExecutionContextOptions(IEnumerable< BadInteropApi > apis)
Creates a new instance of the BadExecutionContextOptions class.
void AddOrReplaceApi(BadInteropApi api)
Adds or Replaces an api in the context.
BadExecutionContext Build()
Builds a new BadExecutionContext with the options provided in this Options Instance.
void AddExtensions(params BadInteropExtension[] extensions)
Adds new Extensions to the context.
void AddApi(BadInteropApi api)
Adds a new Api to the context.
static BadExecutionContextOptions Empty
An Empty BadExecutionContextOptions instance.
BadExecutionContextOptions(params BadInteropApi[] apis)
Creates a new instance of the BadExecutionContextOptions class.
void AddApis(IEnumerable< BadInteropApi > apis)
Adds Apis to the context.
readonly List< BadInteropApi > m_Apis
List of APIs that are loaded in the context.
IEnumerable< BadInteropApi > Apis
List of APIs that are loaded in the context.
void AddExtension< T >()
Adds a new Extension to the context.
BadExecutionContextOptions Clone()
Clones this BadExecutionContextOptions instance.
void AddExtension(BadInteropExtension extension)
Adds a new Extension to the context.
readonly List< BadInteropExtension > m_Extensions
List of Extensions that are loaded in the context.
Implements an Interop API for the BS2 Language.
void Load(BadExecutionContext ctx, BadTable table)
Loads the API into the given Table.
string Name
Name of the API.
Public Extension API for the BS2 Runtime.
Implements a Table Structure for the BadScript Language.
Implements a Class Prototype for the BadScript Language.
string Name
The Name of the Type.
Helper Class that Builds a Native Class from a Prototype.
static IEnumerable< BadClassPrototype > NativeTypes
Enumeration of all Native Class Prototypes.
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Contains Runtime Type Objects.
Contains the Runtime Objects.
Contains the Runtime Implementation.