Class MyGridProgram
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
System.Object
MyGridProgram
Assembly: Sandbox.Common.dll
Syntax
public abstract class MyGridProgram : Object, IMyGridProgram
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.");
}
Constructors
MyGridProgram()
Implements MyGridProgram constructor
Declaration
protected MyGridProgram()
Properties
Echo
Prints out text onto the currently running programmable block's detail info area.
Declaration
public Action<string> Echo { get; protected set; }
Property Value
Type |
Description |
System.Action<System.String> |
|
GridTerminalSystem
Provides access to the grid terminal system as viewed from this programmable block.
Declaration
public IMyGridTerminalSystem GridTerminalSystem { get; protected set; }
Property Value
IGC
Declaration
public IMyIntergridCommunicationSystem IGC { get; }
Property Value
Me
Gets a reference to the currently running programmable block.
Declaration
public IMyProgrammableBlock Me { get; protected set; }
Property Value
Runtime
Gets runtime information for the running grid program.
Declaration
public IMyGridProgramRuntimeInfo Runtime { get; protected set; }
Property Value
Storage
Allows you to store data between game sessions.
Declaration
public string Storage { get; protected set; }
Property Value
Type |
Description |
System.String |
|
World
Gets world information for the running grid program.
Declaration
public IMyGridProgramWorldInfo World { get; protected set; }
Property Value
Explicit Interface Implementations
IMyGridProgram.Echo
Declaration
Action<string> IMyGridProgram.Echo { get; set; }
Returns
Type |
Description |
System.Action<System.String> |
|
IMyGridProgram.GridTerminalSystem
Declaration
IMyGridTerminalSystem IMyGridProgram.GridTerminalSystem { get; set; }
Returns
IMyGridProgram.HasMainMethod
Declaration
bool IMyGridProgram.HasMainMethod { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyGridProgram.HasSaveMethod
Declaration
bool IMyGridProgram.HasSaveMethod { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyGridProgram.IGC_ContextGetter
Declaration
Func<IMyIntergridCommunicationSystem> IMyGridProgram.IGC_ContextGetter { set; }
Returns
IMyGridProgram.Main(String)
Declaration
void IMyGridProgram.Main(string argument)
Parameters
Type |
Name |
Description |
System.String |
argument |
|
IMyGridProgram.Main(String, UpdateType)
Declaration
void IMyGridProgram.Main(string argument, UpdateType updateSource)
Parameters
Type |
Name |
Description |
System.String |
argument |
|
UpdateType |
updateSource |
|
IMyGridProgram.Me
Declaration
IMyProgrammableBlock IMyGridProgram.Me { get; set; }
Returns
IMyGridProgram.Runtime
Declaration
IMyGridProgramRuntimeInfo IMyGridProgram.Runtime { get; set; }
Returns
IMyGridProgram.Save()
Declaration
void IMyGridProgram.Save()
IMyGridProgram.Storage
Declaration
string IMyGridProgram.Storage { get; set; }
Returns
Type |
Description |
System.String |
|
IMyGridProgram.World
Declaration
IMyGridProgramWorldInfo IMyGridProgram.World { get; set; }
Returns
Implements