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

Re: [pbmserv-dev] why is Init() recalled each time? (long)



-> Richard and others,  I need to get some sleep but I just want to
-> throw out this question and ask for a way around this problem.
-> <rant on>
-> Why does the game engine run the function Abalone::Init() 
-> (or for example Backgammon::Init(), etc...) *everytime* that
-> someone makes a move?  I thought that the reason it was called
-> *Init* was that it meant that this function was an INITialization
-> routine that would only run *once* when the game was first started
-> with a 'challenge' command???  But it is not!  This is frustrating! 
-> What I wanted to do was add a few lines in the Abalone::Init()
-> routine so that all _new_ games that were started with *my* new
-> Abalone code would have a special parameter set that would allow
-> the Abalone game engine to recognize which games were still old
-> (using the previous programmer's code) and which games were started
-> with my new revised code.  UHG!!!  I can't do this because the
-> Abalone::Init() routine is run everytime a move is made and therefore
-> my special parameter is inserted even in the old games that were
-> started before any of my code changes.  

If you let Init() increment an int, then only new games is the case
that number of moves equal the value of the int.

/Martin