-
- All Implemented Interfaces:
-
java.util.function.BiConsumer
@FunctionalInterface() public interface DrawCommand<P extends Position2D<out P>> implements BiConsumer<GraphicsContext, Wormhole2D<P>>
Functional interface that models a command for JavaFX thread to draw something on a javafx.scene.canvas.Canvas.
-
-
Method Summary
Modifier and Type Method Description abstract voidaccept(GraphicsContext graphic, Wormhole2D<P> wormhole)The method consumes a graphic and a wormhole to draw something. DrawCommand<P>wrap(Supplier<Boolean> booleanSupplier)Wrapper method that wraps this DrawCommand into another that checks if should execute or not the accept method. -
-
Method Detail
-
accept
abstract void accept(GraphicsContext graphic, Wormhole2D<P> wormhole)
The method consumes a graphic and a wormhole to draw something.
- Parameters:
graphic- the GraphicsContext of a JavaFX javafx.scene.canvas.Canvaswormhole- the Wormhole that maps it.unibo.alchemist.model.interfaces.Environmentpositions to GUI positions
-
wrap
DrawCommand<P> wrap(Supplier<Boolean> booleanSupplier)
Wrapper method that wraps this DrawCommand into another that checks if should execute or not the accept method.
-
-
-
-