Package mindustry.logic
Class GlobalVars
java.lang.Object
mindustry.logic.GlobalVars
Stores global logic variables for logic processors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An entry that describes a variable for documentation purposes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final ContentType[]
static final arc.math.Rand
Global random state.static final arc.struct.Seq<String>
static final ContentType[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarc.struct.Seq<GlobalVars.VarEntry>
void
init()
lookupContent
(ContentType type, int id) int
lookupLogicId
(UnlockableContent content) Adds a constant value by name.Adds a constant value by name.void
putEntryOnly
(String name) void
Sets a global variable by name.void
update()
Updates global time and other state variables.waitVar()
-
Field Details
-
ctrlProcessor
public static final int ctrlProcessor- See Also:
-
ctrlPlayer
public static final int ctrlPlayer- See Also:
-
ctrlCommand
public static final int ctrlCommand- See Also:
-
lookableContent
-
writableLookableContent
-
rand
public static final arc.math.Rand randGlobal random state. -
soundNames
-
-
Constructor Details
-
GlobalVars
public GlobalVars()
-
-
Method Details
-
init
public void init() -
update
public void update()Updates global time and other state variables. -
waitVar
-
getEntries
-
lookupContent
- Returns:
- a piece of content based on its logic ID. This is not equivalent to content ID. In the case of teams, the return value may not be Content.
-
lookupLogicId
- Returns:
- the integer logic ID of content, or -1 if invalid.
-
get
- Returns:
- a constant variable if there is a constant with this name, otherwise null. Attempt to get privileged variable from non-privileged logic executor returns null constant.
-
get
- Returns:
- a constant variable by name Attempt to get privileged variable from non-privileged logic executor returns null constant.
-
set
Sets a global variable by name. -
put
Adds a constant value by name. -
put
Adds a constant value by name. -
put
-
putEntry
-
putEntry
-
putEntryOnly
-