[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
computer-go: Delphi Components
Hello everybody outthere.
Happy newyear to start with :)
I have been programming two small Go-components in Delphi
during my one-week holiday last week. Partly because I couldn't
find a "Open-Go" sort of thing for Delphi and partly because I
could use the excercise.
The idea of my components (called GoBoardGrid and GoBoardGridView) is
that they make it easier to program Go-related applications such as
Go-playing programs, Go-editors and other Go-stuff.
The rules of Go are not implemented yet (that will probably be done in
a descendant of GoBoardGrid) so that other games can be programmed as
well as long as you can play them on a Go-board using black and white
stones.
Before I publish any of my makings I would like some answer to the
question what a potential component-user would like these components
to do. How should they react and what properties should they contain.
To get you started, this is what I implemented so far:
GoBoardGrid
properties:
BoardSize (To change the boardsize)
methods
GetPoint/SetPoint (To read and write stones on the board)
GetMark/SetMark (To read and write markings of some sort)
ClearBoard (Clears the whole board)
ClearMarks (Clears only the markers)
events
OnBoardChange (Is called if the board is changed)
OnMark (Is called if a marker is placed)
GoBoardGridView
properties
Allign (To allign the picture on a form)
Wood (picture) (Containing the bitmap of the wood of the board)
BlackStone (pic) (dito for the black stone)
WhiteStone (pic) (dito for the white stone)
BlackMask (pic) (mask bmp for the black stone)
WhiteMask (pic) (mask bmp for the white stone)
Visible (To make the board-picture invisible/visible)
HoshiSize (To read/write the size of the hoshi points)
MarkSize (To read/write the size of the markers)
MarkFont (To read/write the font for text markers)
methods
Invalidate (To force redrawing of the board)
events
OnPointClick(x,y) (Is called if a boardpoint is clicked)
OnPointDblClick(x,y) (Is called if a boardpoint is double-clicked)
I intend to publish my components when they're finished so that
everyone may use them freely as long as my About-box is included
unchanged as well :)
Greetz, Pieter