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

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



Richard Rognlie wrote:

Define a couple of virtual methods in Game

Game::ShowSGF() Look at the code for Game::ShowAs().

ShowSGF could call doShowSGF... Game::doShowSGF()

which might be defined as 'sgf format not defined for $GameType'


But then you could override that with Go::doShowSGF()


Oops! I hadn't retrieved this email yet, and the above answers one of the questions I just asked, so I am on the right track.

so... game.cpp does the cmd parsing... and calls ShowSGF().

ShowSGF() runs through the list of arguments to get the boards to display
and for each one, calls doShowSGF() [which is board specific]


Again... much like game.cpp calls ShowAs.... which calls PrintBoardAs (details are foggy, but you get the idea)

Actually, ShowAs is exactly what I chose to use as a model, but it and PrintAs wend their ways all over the place!

I'll double check the rest of what I was trying and see how it matches what you described.

Thanks!
 --Rob