Package de.extio.spacecraft.shared.bo
Interface SpaceStationFactory
-
public interface SpaceStationFactory
Factory for space stations that can be entered by players. Such stations, as well as spaceships that can be entered by players, must be added to a ship slot: This class also takes care of that. You can access the corresponding bean implementation via ServerFacade::getBusinessObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
despawn(UUID spaceStationId, GameSession gameSession)
Despawns a station, also unregisters it from the ship slot<T extends SpaceStation>
UUIDspawn(CoordI2 position, String fileMatcher, String modNameMatcher, String path, UUID sceneTag, int team, boolean allTeamsCanEnter, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, Class<T> type, Consumer<T> processor, GameSession gameSession)
Spawns the station at a certain position, also registers it at a ship slot<T extends SpaceStation>
UUIDspawnByMarker(String marker, String fileMatcher, String modNameMatcher, String path, UUID sceneTag, int team, boolean allTeamsCanEnter, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, Class<T> type, Consumer<T> processor, GameSession gameSession)
Spawns the station at the position of a named MarkerEntity, also registers it at a ship slot<T extends SpaceStation>
UUIDspawnStation(CoordI2 position, UUID sceneTag, int team, boolean allTeamsCanEnter, boolean forceKeepPosition, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, T station, Consumer<T> processor, GameSession gameSession)
Spawns a preloaded station at a certain position, also registers it at a ship slot.
-
-
-
Method Detail
-
spawnByMarker
<T extends SpaceStation> UUID spawnByMarker(String marker, String fileMatcher, String modNameMatcher, String path, UUID sceneTag, int team, boolean allTeamsCanEnter, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, Class<T> type, Consumer<T> processor, GameSession gameSession)
Spawns the station at the position of a named MarkerEntity, also registers it at a ship slot- Parameters:
marker
- Name of the MarkerEntityfileMatcher
- Storage filename of CompositeEntityDefinitionMessage to loadmodNameMatcher
- Optional, can be null. Mod name to load CompositeEntityDefinitionMessage frompath
- Storage path of CompositeEntityDefinitionMessage to loadsceneTag
- Optional, can be null. Scene tag (id) the station is part ofteam
- Team number of the stationallTeamsCanEnter
- Permit access to the station to all teams or only the team that the station belongs tospawnAtSlotMinIncl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atspawnAtSlotMaxExcl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atprocessor
- Post processor of the station, e.g. to set additional properties
-
spawn
<T extends SpaceStation> UUID spawn(CoordI2 position, String fileMatcher, String modNameMatcher, String path, UUID sceneTag, int team, boolean allTeamsCanEnter, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, Class<T> type, Consumer<T> processor, GameSession gameSession)
Spawns the station at a certain position, also registers it at a ship slot- Parameters:
position
- Position the station to spawn atfileMatcher
- Storage filename of CompositeEntityDefinitionMessage to loadmodNameMatcher
- Optional, can be null. Mod name to load CompositeEntityDefinitionMessage frompath
- Storage path of CompositeEntityDefinitionMessage to loadsceneTag
- Optional, can be null. Scene tag (id) the station is part ofteam
- Team number of the stationallTeamsCanEnter
- Permit access to the station to all teams or only the team that the station belongs tospawnAtSlotMinIncl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atspawnAtSlotMaxExcl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atprocessor
- Post processor of the station, e.g. to set additional properties
-
spawnStation
<T extends SpaceStation> UUID spawnStation(CoordI2 position, UUID sceneTag, int team, boolean allTeamsCanEnter, boolean forceKeepPosition, int spawnAtSlotMinIncl, int spawnAtSlotMaxExcl, T station, Consumer<T> processor, GameSession gameSession)
Spawns a preloaded station at a certain position, also registers it at a ship slot. The station must not have been added to world manager yet (at least .remove() it from world manager before spawning)- Parameters:
position
- Position the station to spawn atsceneTag
- Optional, can be null. Scene tag (id) the station is part ofteam
- Team number of the stationallTeamsCanEnter
- Permit access to the station to all teams or only the team that the station belongs toforceKeepPosition
- If true keeps station.position when spawning, otherwise the regular logic for spawn positions configured in the ship slot definition appliesspawnAtSlotMinIncl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atspawnAtSlotMaxExcl
- Everything that can be entered by a player must be registered on a ship slot. There can only be one ship registered per slot. This parameter is the minimum of a range of ship slot indexes to register the station atstation
- Preloaded SpaceStation. Make sure it is not added yet to world manager!processor
- Post processor of the station, e.g. to set additional properties
-
despawn
void despawn(UUID spaceStationId, GameSession gameSession)
Despawns a station, also unregisters it from the ship slot- Parameters:
spaceStationId
- Composite entity id of the station to despawn
-
-