BadScript 2
Loading...
Searching...
No Matches
BadInteropApi.cs
Go to the documentation of this file.
1
using
BadScript2.Runtime.Objects
;
2
using
BadScript2.Runtime.Objects.Types
;
3
7
namespace
BadScript2.Runtime.Interop
;
8
12
public
abstract
class
BadInteropApi
13
{
18
protected
BadInteropApi
(
string
name)
19
{
20
Name
= name;
21
}
22
26
public
string
Name
{
get
; }
27
31
public
virtual
Version
Version
=> GetType().Assembly.GetName().Version;
32
37
protected
abstract
void
LoadApi
(
BadTable
target);
38
43
public
void
LoadRawApi
(
BadTable
target)
44
{
45
LoadApi
(target);
46
}
47
52
public
void
Load
(
BadExecutionContext
ctx,
BadTable
table)
53
{
54
BadTable
info =
new
BadTable
();
55
info.SetProperty(
"Name"
,
Name
,
new
BadPropertyInfo
(
BadNativeClassBuilder
.
GetNative
(
"string"
),
true
));
56
info.SetProperty(
"Version"
,
Version
.ToString(),
new
BadPropertyInfo
(
BadNativeClassBuilder
.
GetNative
(
"string"
),
true
));
57
info.SetProperty(
"AssemblyName"
, GetType().Assembly.GetName().Name,
new
BadPropertyInfo
(
BadNativeClassBuilder
.
GetNative
(
"string"
),
true
));
58
59
if
(!table.
HasProperty
(
"Info"
))
60
{
61
table.SetProperty(
"Info"
, info,
new
BadPropertyInfo
(
BadNativeClassBuilder
.
GetNative
(
"Table"
),
true
));
62
}
63
64
LoadApi
(table);
65
ctx.
Scope
.
SetRegisteredApi
(
Name
);
66
}
67
}
BadScript2.Runtime.BadExecutionContext
The Execution Context. Every execution of a script needs a context the script is running in....
Definition
BadExecutionContext.cs:16
BadScript2.Runtime.BadExecutionContext.Scope
BadScope Scope
The Root Scope of the Context.
Definition
BadExecutionContext.cs:29
BadScript2.Runtime.BadScope.SetRegisteredApi
void SetRegisteredApi(string api)
Registers an API.
Definition
BadScope.cs:478
BadScript2.Runtime.Interop.BadInteropApi
Implements an Interop API for the BS2 Language.
Definition
BadInteropApi.cs:13
BadScript2.Runtime.Interop.BadInteropApi.Load
void Load(BadExecutionContext ctx, BadTable table)
Loads the API into the given Table.
Definition
BadInteropApi.cs:52
BadScript2.Runtime.Interop.BadInteropApi.LoadRawApi
void LoadRawApi(BadTable target)
Loads the API into the given Table.
Definition
BadInteropApi.cs:43
BadScript2.Runtime.Interop.BadInteropApi.LoadApi
void LoadApi(BadTable target)
Loads the API into the given Table.
BadScript2.Runtime.Interop.BadInteropApi.BadInteropApi
BadInteropApi(string name)
Creates a new Interop API.
Definition
BadInteropApi.cs:18
BadScript2.Runtime.Interop.BadInteropApi.Name
string Name
Name of the API.
Definition
BadInteropApi.cs:26
BadScript2.Runtime.Interop.BadInteropApi.Version
virtual Version Version
The Version of the API.
Definition
BadInteropApi.cs:31
BadScript2.Runtime.Objects.BadPropertyInfo
Stores Meta Information about a Property.
Definition
BadPropertyInfo.cs:9
BadScript2.Runtime.Objects.BadTable
Implements a Table Structure for the BadScript Language.
Definition
BadTable.cs:14
BadScript2.Runtime.Objects.BadTable.HasProperty
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...
Definition
BadTable.cs:129
BadScript2.Runtime.Objects.Types.BadNativeClassBuilder
Helper Class that Builds a Native Class from a Prototype.
Definition
BadNativeClassBuilder.cs:16
BadScript2.Runtime.Objects.Types.BadNativeClassBuilder.GetNative
static BadClassPrototype GetNative(string name)
Returns a Native Class Prototype for the given Native Type.
Definition
BadNativeClassBuilder.cs:413
BadScript2.Runtime.Interop
Contains the Interop Abstractions and Implementations for the BadScript2 Language.
Definition
BadInteropApi.cs:7
BadScript2.Runtime.Objects.Types
Contains Runtime Type Objects.
Definition
BadAbstractClassException.cs:5
BadScript2.Runtime.Objects
Contains the Runtime Objects.
Definition
BadArray.cs:10
src
BadScript2
Runtime
Interop
BadInteropApi.cs
Generated by
1.9.8