Provides a compiler for scripts, with support for a type whitelist and instruction counting.
More...
|
| MyScriptCompiler () |
|
Task< Assembly > | Compile (MyApiTarget target, string assemblyName, Script script, List< Message > messages, bool enableDebugInformation=false) |
| Compiles a script. More...
|
|
async Task< Assembly > | Compile (MyApiTarget target, string assemblyName, IEnumerable< Script > scripts, List< Message > messages, bool enableDebugInformation=false) |
| Compiles a script. More...
|
|
void | AddReferencedAssemblies (params string[] assemblyLocations) |
| Adds assemblyLocations to be referenced by scripts. More...
|
|
void | AddImplicitIngameNamespacesFromTypes (params Type[] types) |
| Adds the given namespaces for automatic inclusion in the ingame script wrapper. **This method does NOT whitelist namespaces! More...
|
|
void | AddUnblockableIngameExceptions (params Type[] types) |
| Adds the given exceptions to the unblockable list for ingame scripts. These exceptions will be added to try/catch expressions so they cannot be caught in-game. More...
|
|
void | AddConditionalCompilationSymbols (params string[] symbols) |
| Adds a conditional compilation symbol More...
|
|
Script | GetIngameScript (string code, string className, string inheritance, string modifiers="sealed") |
| Creates a complete code file from an ingame script. More...
|
|
Provides a compiler for scripts, with support for a type whitelist and instruction counting.
Definition at line 25 of file MyScriptCompiler.cs.
VRage.Scripting.MyScriptCompiler.MyScriptCompiler |
( |
| ) |
|
|
inline |
void VRage.Scripting.MyScriptCompiler.AddConditionalCompilationSymbols |
( |
params string[] |
symbols | ) |
|
|
inline |
void VRage.Scripting.MyScriptCompiler.AddImplicitIngameNamespacesFromTypes |
( |
params Type[] |
types | ) |
|
|
inline |
Adds the given namespaces for automatic inclusion in the ingame script wrapper. **This method does NOT whitelist namespaces!
- Parameters
-
Definition at line 415 of file MyScriptCompiler.cs.
void VRage.Scripting.MyScriptCompiler.AddReferencedAssemblies |
( |
params string[] |
assemblyLocations | ) |
|
|
inline |
Adds assemblyLocations to be referenced by scripts.
- Parameters
-
Definition at line 394 of file MyScriptCompiler.cs.
void VRage.Scripting.MyScriptCompiler.AddUnblockableIngameExceptions |
( |
params Type[] |
types | ) |
|
|
inline |
Adds the given exceptions to the unblockable list for ingame scripts. These exceptions will be added to try/catch expressions so they cannot be caught in-game.
- Parameters
-
Definition at line 433 of file MyScriptCompiler.cs.
Task<Assembly> VRage.Scripting.MyScriptCompiler.Compile |
( |
MyApiTarget |
target, |
|
|
string |
assemblyName, |
|
|
Script |
script, |
|
|
List< Message > |
messages, |
|
|
bool |
enableDebugInformation = false |
|
) |
| |
|
inline |
Compiles a script.
- Parameters
-
target | |
assemblyName | |
script | |
messages | |
enableDebugInformation | |
- Returns
Definition at line 154 of file MyScriptCompiler.cs.
async Task<Assembly> VRage.Scripting.MyScriptCompiler.Compile |
( |
MyApiTarget |
target, |
|
|
string |
assemblyName, |
|
|
IEnumerable< Script > |
scripts, |
|
|
List< Message > |
messages, |
|
|
bool |
enableDebugInformation = false |
|
) |
| |
|
inline |
Compiles a script.
- Parameters
-
target | |
assemblyName | |
scripts | |
messages | |
enableDebugInformation | |
- Returns
Definition at line 168 of file MyScriptCompiler.cs.
Script VRage.Scripting.MyScriptCompiler.GetIngameScript |
( |
string |
code, |
|
|
string |
className, |
|
|
string |
inheritance, |
|
|
string |
modifiers = "sealed" |
|
) |
| |
|
inline |
Creates a complete code file from an ingame script.
- Parameters
-
code | |
className | |
inheritance | |
modifiers | |
- Returns
Definition at line 483 of file MyScriptCompiler.cs.
HashSetReader<string> VRage.Scripting.MyScriptCompiler.AssemblyLocations |
|
get |
Gets the assembly locations to be referenced by the scripts
Definition at line 88 of file MyScriptCompiler.cs.
HashSetReader<string> VRage.Scripting.MyScriptCompiler.ConditionalCompilationSymbols |
|
get |
Gets the conditional compilation symbols scripts are compiled with.
Definition at line 112 of file MyScriptCompiler.cs.
string VRage.Scripting.MyScriptCompiler.DiagnosticOutputPath |
|
getset |
If this property is set, the compiler will write altered scripts and diagnostics to this folder.
Definition at line 120 of file MyScriptCompiler.cs.
bool VRage.Scripting.MyScriptCompiler.EnableDebugInformation |
|
getset |
Determines whether debug information is enabled on a global level. This decision can be made on a per-script fashion on each of the compile methods, but if this property is set to true
, it will override any parameter value.
Definition at line 143 of file MyScriptCompiler.cs.
HashSet<string> VRage.Scripting.MyScriptCompiler.IgnoredWarnings |
|
get |
Contains the diagnostic codes of warnings that should not be reported by the compiler.
Definition at line 134 of file MyScriptCompiler.cs.
HashSetReader<string> VRage.Scripting.MyScriptCompiler.ImplicitIngameScriptNamespaces |
|
get |
Gets the namespaces that are to be added to the ingame script using list
Definition at line 96 of file MyScriptCompiler.cs.
HashSetReader<Type> VRage.Scripting.MyScriptCompiler.UnblockableIngameExceptions |
|
get |
Gets the exception types that are to be made unblockable in ingame scripts
Definition at line 104 of file MyScriptCompiler.cs.
The documentation for this class was generated from the following file: