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

Re: [pbmserv-dev] Werewolf/Haggis code



Just thought I'd give you an update on where I'm at..

Made program accept arguments to the constructor for setting up 
paths etc with a higher priority than the environment variables (which
it still uses if it doesnt get any arguments) This was useful for
setting up the tests.

Wrote tests, this way I could be sure that any changes I was making
would result in the same output. This includes a test that reads in a
game result message (ie what the server sends on game over) and plays
through the game and outputs its own game over message.  

Once I had tests that things were still working I went to work and
removed all the globals. I ended up attatching most of the to the
perlgame object. But some were removed completetly.

Inspired by a mail message I added alias change command.

Currenlty I'm in the middle of transitioning the Werewolf code to use
a player based hash structure for storing player information rather than
the original lots of individual arrays method.
This will probably have the side effect that the Haggis code will need a
lot of work to be integrated with the perlgame.pm base code. 
But the base code should be much easier to extend for other games.

Questions:

Why is the challenger not automatically joined up to the game?

lastmove: This seems to be currently irrelevant in the werewolf code
except as a measure of inactivity on a board/game level. Does anyone
object to me simplifying the code by removing it for the players?

There is a Cleanup commad that does the nags, does it matter that this
can be called by anyone? (I expect not).

Can anyone see any problem with using the much simpler Data::Dumper to
dump and load game data structures out to file rather than the current
rather 'clever' save game implementation?

I think thats all for now.

Geoff.
kryten.
etc.