Package mindustry.core
Class GameState
java.lang.Object
mindustry.core.GameState
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionint
Number of enemies in the game; only used clientside in servers.Global attributes of the environment, calculated by weather.boolean
Whether the game is in game over state.Map that is currently being played on.Map being playtested (not edited!)The current game rules.int
Server ticks/second.Statistics for this save/game.Team data.double
Logic tick.long
Continuously ticks up every non-paused update.int
Current wave number, can be anything in non-wave modes.float
Wave countdown in ticks.boolean
Whether the player's team won the match. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionmindustry.gen.Unit
boss()
getState()
boolean
boolean
boolean
is
(GameState.State astate) boolean
Note that being in a campaign does not necessarily mean having a sector.boolean
isEditor()
boolean
isGame()
boolean
isMenu()
boolean
isPaused()
boolean
void
set
(GameState.State astate)
-
Field Details
-
wave
public int waveCurrent wave number, can be anything in non-wave modes. -
wavetime
public float wavetimeWave countdown in ticks. -
tick
public double tickLogic tick. -
updateId
public long updateIdContinuously ticks up every non-paused update. -
gameOver
public boolean gameOverWhether the game is in game over state. -
won
public boolean wonWhether the player's team won the match. -
serverTps
public int serverTpsServer ticks/second. Only valid in multiplayer. -
map
Map that is currently being played on. -
rules
The current game rules. -
stats
Statistics for this save/game. Displayed after game over. -
envAttrs
Global attributes of the environment, calculated by weather. -
teams
Team data. Gets reset every new game. -
enemies
public int enemiesNumber of enemies in the game; only used clientside in servers. -
playtestingMap
Map being playtested (not edited!)
-
-
Constructor Details
-
GameState
public GameState()
-
-
Method Details
-
boss
-
set
-
hasSpawns
public boolean hasSpawns() -
isCampaign
public boolean isCampaign()Note that being in a campaign does not necessarily mean having a sector. -
hasSector
public boolean hasSector() -
getSector
-
getPlanet
-
isEditor
public boolean isEditor() -
isPaused
public boolean isPaused() -
isPlaying
public boolean isPlaying() -
isGame
public boolean isGame()- Returns:
- whether the current state is *not* the menu.
-
isMenu
public boolean isMenu() -
is
-
getState
-