Class PlayfieldModifier
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.simulation.tools.PlayfieldModifier
-
public class PlayfieldModifier extends Object
A tool to modify a playfield and place entities on it.- Author:
- Tim Neumann
-
-
Constructor Summary
Constructors Constructor Description PlayfieldModifier(Playfield playfield)Create a new playfield modifier for the given playfield.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidplaceEntityAt(Entity entity, Position position)Place the given entity at the given position on the playfield.voidplaceEntityAtEachPosition(Supplier<? extends Entity> entityFactory, Iterable<Position> positions)Place an entity supplied by the given factory at each of the given positionsvoidplaceMultipleEntitiesAt(Supplier<? extends Entity> entityFactory, int count, Position position)Place the given number of entities supplied by the given factory at the given location.
-
-
-
Constructor Detail
-
PlayfieldModifier
public PlayfieldModifier(Playfield playfield)
Create a new playfield modifier for the given playfield.- Parameters:
playfield- The playfield to create the modifier for
-
-
Method Detail
-
placeEntityAt
public void placeEntityAt(Entity entity, Position position)
Place the given entity at the given position on the playfield.- Parameters:
entity- The entity to placeposition- The position to place the entity at
-
placeMultipleEntitiesAt
public void placeMultipleEntitiesAt(Supplier<? extends Entity> entityFactory, int count, Position position)
Place the given number of entities supplied by the given factory at the given location.- Parameters:
entityFactory- The factory to get the entities fromcount- The number of entities to placeposition- The position to place the entities at
-
placeEntityAtEachPosition
public void placeEntityAtEachPosition(Supplier<? extends Entity> entityFactory, Iterable<Position> positions)
Place an entity supplied by the given factory at each of the given positions- Parameters:
entityFactory- The factory to get the entities frompositions- A list of positions to place the entities at
-
-