Enum BaseCommand.CommandContext
-
- All Implemented Interfaces:
public enum BaseCommand.CommandContext
Represents what screen the player was on when they used the command.
- Since:
2.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CAMPAIGN_MAP
Command was entered on the campaign map.
CAMPAIGN_MARKET
Command was entered in a market.
COMBAT_CAMPAIGN
Command was entered during a battle in the campaign (doesn't include simulation battles).
COMBAT_MISSION
Command was entered during a mission.
COMBAT_SIMULATION
Command was entered during a refit simulation battle.
MAIN_MENU
Command was entered on the main menu.
-
Method Summary
Modifier and Type Method Description boolean
isInCombat()
Returns whether this context is on the combat map. boolean
isInCampaign()
Returns whether this context is on the campaign map. boolean
isInMarket()
Returns whether the player is interacting with a market-containing entity. boolean
isInMainMenu()
Returns whether the player is viewing the main menu. boolean
isCampaignAccessible()
Returns whether the player is in campaign mode, including in campaign battles (even refit simulation battles). SectorEntityToken
getEntityInteractedWith()
Returns the SectorEntityToken the player is in a dialog with, if any. MarketAPI
getMarket()
Returns the MarketAPI of the ) the player is in a dialog with, if any. static Array<BaseCommand.CommandContext>
values()
Returns an array containing the constants of this enum type, in the order they're declared. static BaseCommand.CommandContext
valueOf(String name)
Returns the enum constant of this type with the specified name. -
-
Method Detail
-
isInCombat
boolean isInCombat()
Returns whether this context is on the combat map.
- Returns:
true
if the game is on the combat map,false
otherwise.- Since:
2.4
-
isInCampaign
boolean isInCampaign()
Returns whether this context is on the campaign map.
- Returns:
true
if the game is on the campaign map,false
otherwise.- Since:
2.4
-
isInMarket
boolean isInMarket()
Returns whether the player is interacting with a market-containing entity.
- Returns:
true
if the player is in dialog with a market-containing entity,false
otherwise.- Since:
3.0
-
isInMainMenu
boolean isInMainMenu()
Returns whether the player is viewing the main menu.
- Returns:
true
if the player is at the main menu,false
otherwise.
-
isCampaignAccessible
boolean isCampaignAccessible()
Returns whether the player is in campaign mode, including in campaign battles (even refit simulation battles).
- Returns:
true
if the player is on the campaign map, in a campaign battle, or running a simulation in a campaign refit screen.- Since:
3.0
-
getEntityInteractedWith
SectorEntityToken getEntityInteractedWith()
Returns the SectorEntityToken the player is in a dialog with, if any.
- Returns:
The SectorEntityToken the player is currently in dialog with, or
null
if they are not in a dialog.- Since:
3.0
-
getMarket
MarketAPI getMarket()
Returns the MarketAPI of the ) the player is in a dialog with, if any. { } of the { } the player is currently in dialog with, or { null } if they are not in a dialog with a market-containing entity.
-
values
static Array<BaseCommand.CommandContext> values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.
- Returns:
an array containing the constants of this enum type, in the order they're declared
-
valueOf
static BaseCommand.CommandContext valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
- Returns:
the enum constant with the specified name
-
-
-
-