-
-
Save slior/de1fa1c82a8dd891f8dee303d1ad6e47 to your computer and use it in GitHub Desktop.
Mancala (27b8690b292cc3b612debb26a40609bb882c0ab4) - refactoring drawing code to the BoardUI class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
const {BoardUI} = require("./drawing.js") | |
... | |
class MancalaGame | |
{ | |
constructor (...) | |
{ | |
... | |
this.boardUI = new BoardUI(cnvsELID,this.cellCount,this) | |
this.boardUI.initializeBoardDrawing(); | |
} | |
_redraw() | |
{ | |
this.boardUI.drawBoardState(this.board,this); | |
} | |
togglePlayer() | |
{ | |
this.player = this.player.theOtherOne(); | |
this.boardUI.toggleHighlights(this.player.number); | |
return this.player; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment