Package edu.wisc.game.sql
Class HtmlDisplay
java.lang.Object
edu.wisc.game.sql.HtmlDisplay
Drawing boards in HTML.
Buttons: with some inspiration from
https://stackoverflow.com/questions/63846699/how-do-i-keep-the-selected-button-highlighted
For the buttons etc to work correctly, the HTML page into which this code is included should also include the JS snippet from js/boardDisplay.js
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
htmlDisplay
(Piece[] pieces, int lastMovePos, boolean weShowAllMovables, boolean[] isMoveable, int cellWidth, boolean canMove) static String
notation
(boolean weShowAllMovables)
-
Constructor Details
-
HtmlDisplay
public HtmlDisplay()
-
-
Method Details
-
htmlDisplay
public static String htmlDisplay(Piece[] pieces, int lastMovePos, boolean weShowAllMovables, boolean[] isMoveable, int cellWidth, boolean canMove) - Parameters:
pieces
- An array of N*N values, with nulls for empty cellscanMove
- If true, the player can make a move, so buttons will be enabled
-
notation
-