Package mindustry.logic
Class GlobalVars
java.lang.Object
mindustry.logic.GlobalVars
Stores global logic variables for logic processors.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final ContentType[]
static final Rand
Global random state. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(int id) int
void
init()
lookupContent
(ContentType type, int id) int
lookupLogicId
(UnlockableContent content) int
Adds a constant value by name.void
set
(int id, double value) Sets a global variable by an ID returned from put().void
update()
Updates global time and other state variables.
-
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
-
rand
Global random state.
-
-
Constructor Details
-
GlobalVars
public GlobalVars()
-
-
Method Details
-
init
public void init() -
update
public void update()Updates global time and other state variables. -
lookupContent
- Returns:
- a piece of content based on its logic ID. This is not equivalent to content ID.
-
lookupLogicId
- Returns:
- the integer logic ID of content, or -1 if invalid.
-
get
- Returns:
- a constant ID > 0 if there is a constant with this name, otherwise -1.
-
get
- Returns:
- a constant variable by ID. ID is not bound checked and must be positive.
-
set
public void set(int id, double value) Sets a global variable by an ID returned from put(). -
put
Adds a constant value by name.
-