Package de.extio.spacecraft.shared.bo
Interface EnvironmentGenerator
-
public interface EnvironmentGenerator
Helpers for the environment in space You can access the corresponding bean implementation via EngineFacade::getBusinessObject / ServerFacade::getBusinessObject
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASTEROID_STANDARD_PREFIX
static List<String>
ASTEROID_STANDARD_SUFFIXES
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CoordD2
calcVDirectionNormByGameSessionId()
Returns a normal direction vector.SpaceObject
createAsteroid(CoordI2 dimension, WorldManager worldManager)
Create an asteroid composite entity<T extends AbstractCompositeEntity>
TcreateAsteroid(Class<T> clazz, String defNamePrefix, List<String> defNameSuffixes, CoordI2 dimension, WorldManager worldManager)
Create an asteroid composite entityboolean
place(AbstractCompositeEntity compositeEntity, Area2 area, WorldManager worldManager)
Places an asteroid in a certain area.boolean
place(AbstractCompositeEntity compositeEntity, CoordI2 position, WorldManager worldManager)
Places an asteroid at a certain position.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 asteroidsvoid
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.void
scenarioDarkMatterGrid(double density, WorldManager worldManager)
Spawns and despawns dark matter objects around active players.void
scenarioSceneGrid(int distance, List<String> scenes, WorldManager worldManager, SceneRegistry sceneRegistry)
Spawns certain scenes constantly around the player.
-
-
-
Field Detail
-
ASTEROID_STANDARD_PREFIX
static final String ASTEROID_STANDARD_PREFIX
- See Also:
- Constant Field Values
-
-
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
SpaceObject createAsteroid(CoordI2 dimension, WorldManager worldManager)
Create an asteroid composite entity
-
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 doubtdefNamePrefix
- Prefix to choose from entity definitions. Use ASTEROID_STANDARD_PREFIX if in doubtdefNameSuffixes
- Suffixes to choose from different asteroid types (suffix must be part of the entity def name). Use ASTEROID_STANDARD_SUFFIXES if in doubtdimension
- Size of the asteroid
-
place
boolean place(AbstractCompositeEntity compositeEntity, CoordI2 position, WorldManager worldManager)
Places an asteroid at a certain position. Checks e.g. if space is free
-
place
boolean place(AbstractCompositeEntity compositeEntity, Area2 area, WorldManager worldManager)
Places an asteroid in a certain area. Checks e.g. if space is free
-
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 asteroidssizeMax
- Max size of asteroidsdensity
- Density of asteroid belt, values between 0.0 and 1.0velocityMin
- Min velocity, can be 0.0velocityMax
- Max velocity, can be 0.0vDirectionNorm
- If asteroids should have a velocity, set a normal vector (length 1) here to indicate the directionarea
- Area to place the asteroid belt inrandomPositionPredicate
- 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()
-
-