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 Detail

      • spawnByMarker

        <T extends SpaceStationUUID 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 MarkerEntity
        fileMatcher - Storage filename of CompositeEntityDefinitionMessage to load
        modNameMatcher - Optional, can be null. Mod name to load CompositeEntityDefinitionMessage from
        path - Storage path of CompositeEntityDefinitionMessage to load
        sceneTag - Optional, can be null. Scene tag (id) the station is part of
        team - Team number of the station
        allTeamsCanEnter - Permit access to the station to all teams or only the team that the station belongs to
        spawnAtSlotMinIncl - 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 at
        spawnAtSlotMaxExcl - 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 at
        processor - Post processor of the station, e.g. to set additional properties
      • spawn

        <T extends SpaceStationUUID 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 at
        fileMatcher - Storage filename of CompositeEntityDefinitionMessage to load
        modNameMatcher - Optional, can be null. Mod name to load CompositeEntityDefinitionMessage from
        path - Storage path of CompositeEntityDefinitionMessage to load
        sceneTag - Optional, can be null. Scene tag (id) the station is part of
        team - Team number of the station
        allTeamsCanEnter - Permit access to the station to all teams or only the team that the station belongs to
        spawnAtSlotMinIncl - 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 at
        spawnAtSlotMaxExcl - 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 at
        processor - Post processor of the station, e.g. to set additional properties
      • spawnStation

        <T extends SpaceStationUUID 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 at
        sceneTag - Optional, can be null. Scene tag (id) the station is part of
        team - Team number of the station
        allTeamsCanEnter - Permit access to the station to all teams or only the team that the station belongs to
        forceKeepPosition - If true keeps station.position when spawning, otherwise the regular logic for spawn positions configured in the ship slot definition applies
        spawnAtSlotMinIncl - 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 at
        spawnAtSlotMaxExcl - 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 at
        station - 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