Class GameModeDefShipSlot
- java.lang.Object
-
- de.extio.spacecraft.shared.model.game.GameModeDefShipSlot
-
public final class GameModeDefShipSlot extends Object
-
-
Constructor Summary
Constructors Constructor Description GameModeDefShipSlot()
GameModeDefShipSlot(GameModeDefShipSlot other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
getFixedTeam()
Fixed team for this ship, players will not be able to change the team in lobby.String
getShipClassName()
Limit loading ships for this ship slot to a certain ship class.String
getShipPreload()
Preload this ship when creating the ship slot.String
getShipPreloadCustomType()
By default the preloaded ship is converted to SpaceShip java class, which is the default java class for ships that players can join.String
getShipSpawnAt()
Spawn the ship at a defined SpacecraftSpawnPointEntity, which can be placed to the initial scene in scene editor.Integer
getTeam()
Default team for this ship.boolean
isAiDefault()
Defines the default of the AI toggle in lobby.boolean
isAiToggle()
Whether players can toggle AI mode on this ship slotboolean
isAutoLock()
Whether the ship slot is locked (no other user can join) automatically if a user joins the slot.boolean
isClosable()
Whether a user can close (deactivate) this ship slot.boolean
isDefaultActive()
Whether to activate a ship slot by default or not.boolean
isJoinable()
Whether players can join this ship in lobby.boolean
isJoinInitially()
Players will join this ship immediately when joining the game.boolean
isOpenable()
Whether a user can open (activate) this ship slot.boolean
isShipLoadable()
Whether players are able to load their own ship in lobby at this ship slotboolean
isShipSpawnExternalPosition()
Set to true to omit the standard spawn mechanism.void
setAiDefault(boolean aiDefault)
void
setAiToggle(boolean aiToggle)
void
setAutoLock(boolean autoLock)
void
setClosable(boolean closable)
void
setDefaultActive(boolean defaultActive)
void
setFixedTeam(Integer fixedTeam)
void
setJoinable(boolean joinable)
void
setJoinInitially(boolean joinInitially)
void
setOpenable(boolean openable)
void
setShipClassName(String shipClassName)
void
setShipLoadable(boolean shipLoadable)
void
setShipPreload(String shipPreload)
void
setShipPreloadCustomType(String shipPreloadCustomType)
void
setShipSpawnAt(String shipSpawnAt)
void
setShipSpawnExternalPosition(boolean shipSpawnExternalPosition)
void
setTeam(Integer team)
-
-
-
Constructor Detail
-
GameModeDefShipSlot
public GameModeDefShipSlot()
-
GameModeDefShipSlot
public GameModeDefShipSlot(GameModeDefShipSlot other)
-
-
Method Detail
-
isDefaultActive
public boolean isDefaultActive()
Whether to activate a ship slot by default or not. Only active ship slots can have a ship assigned and are displayed in lobby. Inactive ship slots can be activated in lobby with the Plus button if openable.
-
setDefaultActive
public void setDefaultActive(boolean defaultActive)
-
getShipClassName
public String getShipClassName()
Limit loading ships for this ship slot to a certain ship class. The ship does not need to use exactly this ship class, but the ship will be validated to be compatible to this class.
-
setShipClassName
public void setShipClassName(String shipClassName)
-
getShipPreload
public String getShipPreload()
Preload this ship when creating the ship slot. Relative path from mod storage folder, e.g. ships/race/race_1.xml
-
setShipPreload
public void setShipPreload(String shipPreload)
-
isShipLoadable
public boolean isShipLoadable()
Whether players are able to load their own ship in lobby at this ship slot
-
setShipLoadable
public void setShipLoadable(boolean shipLoadable)
-
isClosable
public boolean isClosable()
Whether a user can close (deactivate) this ship slot. Slots can always be closed programmatically.
-
setClosable
public void setClosable(boolean closable)
-
isAiDefault
public boolean isAiDefault()
Defines the default of the AI toggle in lobby. Ships with AI toggle enabled that have no player joined are controlled by AI
-
setAiDefault
public void setAiDefault(boolean aiDefault)
-
isAiToggle
public boolean isAiToggle()
Whether players can toggle AI mode on this ship slot
-
setAiToggle
public void setAiToggle(boolean aiToggle)
-
getTeam
public Integer getTeam()
Default team for this ship.
-
setTeam
public void setTeam(Integer team)
-
getFixedTeam
public Integer getFixedTeam()
Fixed team for this ship, players will not be able to change the team in lobby.
-
setFixedTeam
public void setFixedTeam(Integer fixedTeam)
-
isJoinable
public boolean isJoinable()
Whether players can join this ship in lobby. If false, players can still be moved to this ship programmatically.
-
setJoinable
public void setJoinable(boolean joinable)
-
isJoinInitially
public boolean isJoinInitially()
Players will join this ship immediately when joining the game. Otherwise they need to join a ship manually in lobby. Multiple ships can have set this true, it will cycle to the next ship if ship is full.
-
setJoinInitially
public void setJoinInitially(boolean joinInitially)
-
getShipPreloadCustomType
public String getShipPreloadCustomType()
By default the preloaded ship is converted to SpaceShip java class, which is the default java class for ships that players can join. You can provide a fully qualified class name here to convert the ship to instead. It must derive from SpaceShip.
-
setShipPreloadCustomType
public void setShipPreloadCustomType(String shipPreloadCustomType)
-
getShipSpawnAt
public String getShipSpawnAt()
Spawn the ship at a defined SpacecraftSpawnPointEntity, which can be placed to the initial scene in scene editor. Leave it empty to use the standard spawn mechanism (== spawn at any SpacecraftSpawnPointEntity or a random position if none is loaded)
-
setShipSpawnAt
public void setShipSpawnAt(String shipSpawnAt)
-
isAutoLock
public boolean isAutoLock()
Whether the ship slot is locked (no other user can join) automatically if a user joins the slot. The user can unlock the slot in the lobby.
-
setAutoLock
public void setAutoLock(boolean autoLock)
-
isShipSpawnExternalPosition
public boolean isShipSpawnExternalPosition()
Set to true to omit the standard spawn mechanism. Ships must be positioned programmatically
-
setShipSpawnExternalPosition
public void setShipSpawnExternalPosition(boolean shipSpawnExternalPosition)
-
isOpenable
public boolean isOpenable()
Whether a user can open (activate) this ship slot. Slots can always be opened programmatically.
-
setOpenable
public void setOpenable(boolean openable)
-
-