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

[pbmserv-dev] Adding a command to a game



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