Interface EnvironmentView
- All Known Subinterfaces:
EnvironmentControl
- All Known Implementing Classes:
Environment
public interface EnvironmentView
Provides a read-only view of the game environment.
EnvironmentView exposes the current state of the environment,
including the map, entities, and services such as collision and movement handling.
It also provides methods to spawn or despawn entities at specific locations.
For full control of the environment (updating state or adding/removing entities),
see EnvironmentControl.
-
Method Summary
Modifier and TypeMethodDescriptionvoidDespawns an entity from the environment.Returns the collision service responsible for handling entity collisions.Returns a list of entities currently present in the environment.Returns the event bus used for broadcasting and listening to game events.getMap()Returns the tile map representing the environment's layout.Returns the movement service responsible for moving entities in the environment.voidSpawns an entity at the specified location in the environment.
-
Method Details
-
getMap
TileMap getMap()Returns the tile map representing the environment's layout.- Returns:
- the
TileMapof the environment - See Also:
-
getEntities
Returns a list of entities currently present in the environment. -
getCollisionService
CollisionService getCollisionService()Returns the collision service responsible for handling entity collisions.- Returns:
- the
CollisionServicefor the environment
-
getMovementService
MovementService getMovementService()Returns the movement service responsible for moving entities in the environment.- Returns:
- the
MovementServicefor the environment
-
getEventBus
EventBus getEventBus()Returns the event bus used for broadcasting and listening to game events.- Returns:
- the
EventBusof the environment
-
spawn
Spawns an entity at the specified location in the environment.After spawning, the entity will appear in
getEntities(). -
despawn
Despawns an entity from the environment.After despawning, the entity will no longer appear in
getEntities().- Parameters:
entity- theEntityto remove- See Also:
-