Click or drag to resize
MyGridProgram Class

[This is preliminary documentation and is subject to change.]

All programmable block scripts derive from this class, meaning that all properties in this class are directly available for use in your scripts. If you use Visual Studio or other external editors to write your scripts, you can derive directly from this class and have a compatible script template.
Inheritance Hierarchy
SystemObject
  Sandbox.ModAPI.IngameMyGridProgram

Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common (in Sandbox.Common.dll) Version: 1.0.0.0
Syntax
C#
public abstract class MyGridProgram : IMyGridProgram

The MyGridProgram type exposes the following members.

Properties
  NameDescription
Public propertyEcho
Prints out text onto the currently running programmable block's detail info area.
Public propertyElapsedTime
Gets the amount of in-game time elapsed from the previous run.
Public propertyGridTerminalSystem
Provides access to the grid terminal system as viewed from this programmable block.
Public propertyMe
Gets a reference to the currently running programmable block.
Public propertyRuntime
Gets runtime information for the running grid program.
Public propertyStorage
Allows you to store data between game sessions.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate propertyIMyGridProgramEcho
Gets or sets the action which prints out text onto the currently running programmable block's detail info area.
Explicit interface implementationPrivate propertyIMyGridProgramElapsedTime
Gets or sets the amount of time elapsed since the last time this grid program was run.
Explicit interface implementationPrivate propertyIMyGridProgramGridTerminalSystem
Gets or sets the GridTerminalSystem available for the grid programs.
Explicit interface implementationPrivate propertyIMyGridProgramHasMainMethod
Determines whether this grid program has a valid Main method.
Explicit interface implementationPrivate propertyIMyGridProgramHasSaveMethod
Determines whether this grid program has a valid Save method.
Explicit interface implementationPrivate methodIMyGridProgramMain
Invokes this grid program.
Explicit interface implementationPrivate propertyIMyGridProgramMe
Gets or sets the programmable block which is currently running this grid program.
Explicit interface implementationPrivate propertyIMyGridProgramRuntime
Gets or sets the object used to provide runtime information for the running grid program.
Explicit interface implementationPrivate methodIMyGridProgramSave
If this grid program has state saving capability, calling this method will invoke it.
Explicit interface implementationPrivate propertyIMyGridProgramStorage
Gets or sets the storage string for this grid program.
Top
Examples
public void Main()
{
    // Print out the time elapsed since the currently running programmable block was run
    // the last time.
    Echo(Me.CustomName + " was last run " + Runtime.TimeSinceLastRun.TotalSeconds + " seconds ago.");
}
See Also