Class Board
Represents Go Board
Defined in: board06.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Board(ro, context)
Creates Go Board Object
|
Field Attributes | Field Name and Description |
---|---|
number of lines
|
Method Attributes | Method Name and Description |
---|---|
clear()
Restore go board as initial state
|
|
drawBoard(s, context)
Draw go board
|
|
drawStar(col, row, context)
Draw a star
|
|
drawStone(col, row, stone, context3, context2)
Draw a stone
|
|
drawWoodGrain(x, y, width, height, context)
Draw wood grain
|
|
move(col, row, context3, context2)
Place next stone
|
|
offsetToMove(x, y)
Convert from canvas offset to move
|
|
removeStones(d, stone, context3, context2)
Remove stones
|
Class Detail
Board(ro, context)
Creates Go Board Object
- Parameters:
- {Number} ro
- number of lines
- {Context} context
- context of the canvas
- Since:
- 0.1
Field Detail
{Number}
ro
number of lines
Method Detail
clear()
Restore go board as initial state
- Since:
- 0.2
drawBoard(s, context)
Draw go board
- Parameters:
- {Number} s
- length of shadow(height / 2)
- {Context} context
- context for drawing
- Since:
- 0.1
drawStar(col, row, context)
Draw a star
- Parameters:
- {Number} col
- column position for the star
- {Number} row
- row position for the star
- {Context} context
- context for drawing star
- Since:
- 0.1
drawStone(col, row, stone, context3, context2)
Draw a stone
- Parameters:
- {Number} col
- column position of the stone
- {Number} row
- row posetion of the stone
- {Number} stone
- stone color (BLACK or WHITE)
- {Context} context3
- context for drawing stone
- {Context} context2
- context for drawing shadow
- Since:
- 0.2
drawWoodGrain(x, y, width, height, context)
Draw wood grain
- Parameters:
- {Number} x
- left co-ordinate
- {Number} y
- top co-ordinate
- {Number} width
- width to draw
- {Number} height
- height to draw
- {Context} context
- context to draw
- Since:
- 0.1
{Boolean}
move(col, row, context3, context2)
Place next stone
brd.move(col, row, context3, context2); brd.move(PASS, context3, context2); brd.move(new Move(col, row), context3, context2);
- Parameters:
- {Number} col
- stone column
- {Number} row
- stone row
- {Context} context3
- context for drawing stone
- {Context} context2
- context for drawing shadow
- Since:
- 0.6
- Returns:
- {Boolean} true if the move succeeded
{Move}
offsetToMove(x, y)
Convert from canvas offset to move
- Parameters:
- {Number} x
- X co-ordinate on canvas
- {Number} y
- Y co-ordinate on canvas
- Since:
- 0.2
- Returns:
- {Move} positon to move
removeStones(d, stone, context3, context2)
Remove stones
- Parameters:
- {BVector} d
- BVecter for captured stones
- {Number} stone
- captured stone color (BLACK or WHITE)
- {Context} context3
- context for stone drawn
- {Context} context2
- context for shadow drawn
- Since:
- 0.2