[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] Adding a command to a game



I must say that adding a command to game.cpp is an
ambitious step!  Given that sgf is a way to display a
game, perhaps you might be able to set up a game
option "I want to receive the game in sgf format" and
then override the displayboard method?  This would not
require any changes at the level of game.cpp (I could
help step through the steps it would take).

It has been a while since I looked at sgf.  Is it in
XML?

Lyman

--- Robert Barrell <games@rdbhn.org> wrote:

> Hello.
> 
> For my first foray into PBM-related development, I
> would like to add an 
> SGF function to Go.  I have a test server set up,
> and have the code 
> almost done, but I am used to using C, AWK, Shell,
> etc., and not C++, so 
> I have not yet figured out how to get it to work
> from the go.cpp module 
> (at this point, it is working fine within game.cpp).
>  Ideally, since the 
> SGF format also supports other games, the best
> approach would be to:
> 
> * Add an "sgf" comnmand to game.cpp and have it call
> the SGF function of 
> the game for which it is being run.
> * Add the functioning SGF function to go.cpp for use
> now.
> * Add SGF functions to the code for existing games,
> but have them return 
> a "failure" status so that game.cpp could say "The
> 'sgf' command is not 
> implemented for game %s" but also allow future SGF
> programmers to add 
> SGF to other games without having to modify game.cpp
> or game.h (they 
> would only need to have their SGF function return a
> "success" status).
> 
> Unfortunately, after trying several different
> things, I have not been 
> able to figure out how to make the function a member
> of the Go class, 
> then have it called from the command-parsing section
> of game.cpp.
> 
> Any ideas?
> 
> Thanks!
>   --Rob
> 
> 
> 
> To unsubscribe, send a message to esquire@gamerz.net
> with
> 	unsubscribe pbmserv-dev@gamerz.net
> as the BODY of the message.  The SUBJECT is ignored.
> 
>