-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclient.mode.free.coffee
27 lines (27 loc) · 1.02 KB
/
client.mode.free.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
sceneMaker["free"] = ->
showGameResult = ->
emptyElement(ui.boardDialog)
result = context.game.getResult()
resultText =
GameHelper.getResultText(result)
ui.board.addLabel(resultText, new Point(0, -160), 96)
ui.board.addButton("确定", new Point(0, 160), GoHome)
ui.board.showDialog()
addGameButtons = ->
ui.board.addButton("返回", new Point(0, -160), -> ui.board.hideDialog())
ui.board.addButton("Pass", new Point(0, 0), ->
ui.board.hideDialog()
GameHelper.playMoveInBoard(null)
if context.game.isEnded()
GameHelper.applyScoringAgent(context.game)
context.scene.isEnded = true
showGameResult()
)
ui.board.addButton("认输", new Point(0, 160), ->
context.game.resign()
context.scene.isEnded = true
showGameResult()
)
addGameButtons()
ui.board.isBlocked = false
context.game = new LegalGame(19, 7.5)