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

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



Well yes, come to think of it there are somw drawbacks
to what I was proposing.  For example, if you do a
"show" rather than a "showas" you are not in the
context of any specific user.

Possibly adding a command is the most reasonable
option...

As noted virtual methods can have a default
implementation usable by all classes that do not
specifically override it, or in some cases a method
can be made "pure virtual" in which case any concrete
class that extends the base is forced to override it.

Cheers,

Lyman

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

> Lyman Hurd wrote:
> 
> >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).
> >  
> >
> If I interpret your response correctly, that would
> mean that any game 
> started with the sgf option would only (perhaps only
> for one player) 
> deliver SGF for the duration of the game.  Unless
> there were a more 
> direct interface between SGF and the PBM server
> (i.e. UGS or GMP 
> protocol), that would be of limited usefulness. Even
> the client programs 
> for IGS, NNGS, KGS, et al, don't work directly with
> SGF, however, but 
> have commands to allow users to download SGF.  Thus,
> it's really more 
> appropriate that the normal flow of the game
> continue as it is, but that 
> there be a separate method by which SGF may be
> generated when wanted.  
> If that kind of functionality may be accomplished in
> the manner you are 
> offering, by all means, continue.
> 
> On the other hand, the only thing that doesn't work
> from my current 
> coding of sgf as a command are having it work from
> within go.cpp, and 
> adding code to return an error if the command is
> called for other games.
> 
> Would it be correct to say of C++ that, if the sgf
> function were created 
> within the Game class, and set up to return 0, then
> every game would 
> inherit that version of the function unless the game
> specifically 
> contained its own instance of an sgf function to
> replace it?  If so, of 
> my originally stated issues, the only one that would
> really need to be 
> addressed is how to get the function to work from
> within the particular 
> game module.
> 
> >It has been a while since I looked at sgf.  Is it
> in
> >XML?
> >
> No idea: I have never looked at XML.  Here more
> info: 
> http://www.red-bean.com/sgf/
> 
> 
> 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.
> 
>