2023-05-11 14:32:48 +00:00
|
|
|
import { GoBoard } from "./components/Board";
|
2023-05-11 13:39:31 +00:00
|
|
|
import { CoreApi, initCore } from "./coreApi";
|
2023-05-10 13:42:02 +00:00
|
|
|
|
|
|
|
const main = async () => {
|
2023-05-11 13:39:31 +00:00
|
|
|
let coreApi = await initCore();
|
|
|
|
let response = await coreApi.playingField();
|
2023-05-10 13:42:02 +00:00
|
|
|
console.log("playing field response: ", response);
|
2023-05-11 14:32:48 +00:00
|
|
|
|
|
|
|
const root = document.getElementById("root");
|
|
|
|
if (!root) {
|
|
|
|
alert("could not retrieve the app root container");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-05-14 02:16:24 +00:00
|
|
|
const board = new GoBoard(response.board);
|
|
|
|
root.appendChild(board.canvas);
|
2023-05-11 14:32:48 +00:00
|
|
|
console.log("constructed board: ", board);
|
2023-05-14 02:16:24 +00:00
|
|
|
board.renderBoard();
|
2023-05-10 13:42:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
main();
|