private void drawAvailableMoves() { Piece piece = pieceLocator.getPiece(at.getX(), at.getY()); MovementStrategy movementStrategy = pieceLogicFactory.getMovementStrategy(piece.getType()); List<Move> moves = movementStrategy.getPossibleMoves(at.getX(), at.getY(), piece, pieceLocator); for (Move move : moves) { LayeredGroup group = boardUI.getBoardSquares()[move.getX()][move.getY()]; Piece pieceAt = pieceLocator.getPiece(move.getX(), move.getY()); String imageSource = pieceAt != null ? "img/fire.png" : "img/selected.png"; ImageView view = new ImageView(ImageHelper.getImage(imageSource)); group.putChild(SELECTED_KEY, view); overlayedGroups.add(group); } }
private Node getPieceOverlay() { return boardUI.getBoardSquares()[at.getX()][at.getY()].getChild(PiecesOverlay.PIECES_KEY); }