Interface EnvironmentGenerator


  • public interface EnvironmentGenerator
    Helpers for the environment in space You can access the corresponding bean implementation via EngineFacade::getBusinessObject / ServerFacade::getBusinessObject
    • Method Detail

      • scenarioContinuousAsteroidBelt

        void scenarioContinuousAsteroidBelt​(int sizeMin,
                                            int sizeMax,
                                            double density,
                                            double velocityMin,
                                            double velocityMax,
                                            boolean fillAsteroidsInViewPorts,
                                            boolean skipSceneAreas,
                                            WorldManager worldManager)
        Spawns and despawns asteroids constantly that the player feels like flying inside of an asteroid belt. Call it each server turn.
      • scenarioDarkMatterGrid

        void scenarioDarkMatterGrid​(double density,
                                    WorldManager worldManager)
        Spawns and despawns dark matter objects around active players. Call it each server turn.
      • scenarioSceneGrid

        void scenarioSceneGrid​(int distance,
                               List<String> scenes,
                               WorldManager worldManager,
                               SceneRegistry sceneRegistry)
        Spawns certain scenes constantly around the player. Call it each server turn.
      • createAsteroid

        <T extends AbstractCompositeEntity> T createAsteroid​(Class<T> clazz,
                                                             String defNamePrefix,
                                                             List<String> defNameSuffixes,
                                                             CoordI2 dimension,
                                                             WorldManager worldManager)
        Create an asteroid composite entity
        Parameters:
        clazz - Composite entity class type to return. Use SpaceObject if in doubt
        defNamePrefix - Prefix to choose from entity definitions. Use ASTEROID_STANDARD_PREFIX if in doubt
        defNameSuffixes - Suffixes to choose from different asteroid types (suffix must be part of the entity def name). Use ASTEROID_STANDARD_SUFFIXES if in doubt
        dimension - Size of the asteroid
      • placeAsteroidBelt

        List<SpaceObject> placeAsteroidBelt​(int sizeMin,
                                            int sizeMax,
                                            double density,
                                            double velocityMin,
                                            double velocityMax,
                                            CoordD2 vDirectionNorm,
                                            Area2 area,
                                            WorldManager worldManager,
                                            BiPredicate<MutableCoordI2,​CoordI2> randomPositionPredicate)
        Generates and places a whole belt of asteroids
        Parameters:
        sizeMin - Min size of asteroids
        sizeMax - Max size of asteroids
        density - Density of asteroid belt, values between 0.0 and 1.0
        velocityMin - Min velocity, can be 0.0
        velocityMax - Max velocity, can be 0.0
        vDirectionNorm - If asteroids should have a velocity, set a normal vector (length 1) here to indicate the direction
        area - Area to place the asteroid belt in
        randomPositionPredicate - Generates the position of the next asteroid to be spawned (set coordinates in first argument MutableCoordI2 "by ref", this is a mutable variable). Return false to abort.
      • calcVDirectionNormByGameSessionId

        CoordD2 calcVDirectionNormByGameSessionId()
        Returns a normal direction vector. It stays the same for the game session. Can be used for example as direction vector in placeAsteroidBelt()