Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

Accessing GridTerminalSystem from Sub-class without statics?

$
0
0
Sorry if this is a really obvious question but I couldn't find an answer elsewhere.

Since I started in-game scripting, I've always created a static reference to the master Program - something I almost certainly copied from someone else - at the top of the main script:

Code:
static Program me;

public Program()
{
	me = this;
}
I can then access GridTerminalSystem from anywhere via me.GridTerminalSystem.

Malware has frequently said that statics are bad, mmkay. As I'm just a hobbyist...

Accessing GridTerminalSystem from Sub-class without statics?

Viewing all articles
Browse latest Browse all 645

Trending Articles