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 classAn entry that describes a variable for documentation purposes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final ContentType[]static final arc.math.RandGlobal random state.static final ContentType[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarc.struct.Seq<GlobalVars.VarEntry>voidinit()lookupContent(ContentType type, int id) intlookupLogicId(UnlockableContent content) Adds a constant value by name.Adds a constant value by name.voidputEntryOnly(String name) voidvoidRemoves a global variable - used for data patch reset.voidSets a global variable by name.voidupdate()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.
-
-
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, or null.
-
get
- Returns:
- a constant variable by name. Attempting to get privileged variable from a non-privileged logic executor returns a null constant.
-
set
Sets a global variable by name. -
put
Adds a constant value by name. -
put
Adds a constant value by name. -
remove
Removes a global variable - used for data patch reset. This variable is assumed not to be privileged or have a documentation entry. -
remove
-
put
-
putEntry
-
putEntry
-
putEntryOnly
-