Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

The Program Wrapper And Why You Need It

Malware edited this page Oct 7, 2017 · 1 revision

Again let's look at the program wrapper used in MDK projects.

namespace IngameScript
{
    partial class Program : MyGridProgram
    {
        // Your Script Goes Here
    }
}

This wrapper class has two purposes: Firstly to provide access to the game specific constructs like GridTerminalSystem and Echo. Secondly it's here to simulate the environment your script executes in when the programmable block is running your script.

All your code, even classes and other types, should be wrapped this way to make sure that Visual Studio behaves the same way the Programmable Block will. If you don't, you risk getting compiler errors in Visual Studio that will not happen in the programmable block, and vice versa. The only exception to this wrapping rule are the officially sanctioned "exploit" that are extension classes.

Clone this wiki locally