public class Global extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
CODEX_TOOLTIP_MODE |
static boolean |
LOADING_SAVE |
| Constructor and Description |
|---|
Global() |
| Modifier and Type | Method and Description |
|---|---|
static CombatEngineAPI |
getCombatEngine()
Gets the
CombatEngineAPI, which is typically active in combat, on the main menu, and on the refit screen. |
static GameState |
getCurrentState() |
static FactoryAPI |
getFactory()
Used to create fleets, markets, cargo, crew compositions, jump points, progress indicators,
memory objects, persons, officer data, battles, cargo stacks, communication messages, fleet stubs,
and fleet AI, along with various orbit configurations and fleet members.
|
static org.apache.log4j.Logger |
getLogger(java.lang.Class c)
Creates a new
Logger that will add the given class to all log messages it produces. |
static SectorAPI |
getSector()
Gets the currently loaded save game's
SectorAPI, which contains all StarSystemAPIs,
FleetAPIs, the sectory MemoryAPI, and more. |
static SectorAPI |
getSectorAPI()
Deprecated.
use
getSector() instead |
static SettingsAPI |
getSettings()
Gets the
SettingsAPI, which contains access to current settings and many useful utility methods. |
static SettingsAPI |
getSettingsAPI()
Deprecated.
use
getSettings() instead |
static SoundPlayerAPI |
getSoundPlayer()
Gets the
SoundPlayerAPI, which is used to play sound effects and music. |
static void |
setCombatEngine(CombatEngineAPI combatEngine) |
static void |
setFactory(FactoryAPI factory) |
static void |
setSector(SectorAPI api) |
static void |
setSettings(SettingsAPI api) |
static void |
setSoundPlayer(SoundPlayerAPI sound) |
public static boolean CODEX_TOOLTIP_MODE
public static boolean LOADING_SAVE
public Global()
public static GameState getCurrentState()
public static org.apache.log4j.Logger getLogger(java.lang.Class c)
Logger that will add the given class to all log messages it produces.
class MyClass {
Logger log = Global.getLogger(MyClass.class);
void myMethod() {
log.info("Hello, world!");
}
}
c - the class to add to the log messagespublic static FactoryAPI getFactory()
public static void setFactory(FactoryAPI factory)
public static SoundPlayerAPI getSoundPlayer()
SoundPlayerAPI, which is used to play sound effects and music.public static void setSoundPlayer(SoundPlayerAPI sound)
public static SettingsAPI getSettings()
SettingsAPI, which contains access to current settings and many useful utility methods.public static void setSettings(SettingsAPI api)
public static SectorAPI getSector()
SectorAPI, which contains all StarSystemAPIs,
FleetAPIs, the sectory MemoryAPI, and more.
On the main menu, this may or may not be null.
public static CombatEngineAPI getCombatEngine()
CombatEngineAPI, which is typically active in combat, on the main menu, and on the refit screen.
Mainly used to get info about and modify battles.public static void setCombatEngine(CombatEngineAPI combatEngine)
@Deprecated public static SettingsAPI getSettingsAPI()
getSettings() instead@Deprecated public static SectorAPI getSectorAPI()
getSector() instead