Created
May 24, 2018 18:07
-
-
Save tuykin/ec730df3aa43a8b5096f79e71f95eefe to your computer and use it in GitHub Desktop.
GameDrawer
This file contains hidden or 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
var cfg = { | |
boxes_count: 10, | |
players_count: 3, | |
boxes_seq: 'random' // 'sequental' | |
} | |
var game = new Game(cfg) | |
var bone_value = game.dropBone(); | |
game.currentPlayer.moveTo(bone_value); | |
var gameTable = new GameTable(game) | |
gameTable.drawBoxes(); | |
var gameDrawer = new GameDrawer(game); | |
gameDrawer.drawBoxes(); | |
class GameDrawer { | |
contstructor(game) { | |
this.game = game; | |
} | |
drawBox(box) { | |
} | |
drawBoxes() { | |
this.game.boxes.each { this.drawBox(box) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment