From: Erik V. <eri...@hc...> - 2005-03-05 22:09:53
|
> >Well, you can always call toString(), but perhaps you mean > >to customise its output? Like what? > ><snip> > Yes, I meant customizing the toString() output. I highly > doubt the default toString() output will be > very helpful. ;-) ><snip> > Perhaps if we use toString() to output the current object > state as XML, that gives us an easy method of generating > both game logs and a game state file for things like PBEM. OK. I presume that in the case of the stockmarket we only need to save the token locations, as all other info is available in the initialisation XML (item <stockmarket>). So would the following toString() output be OK for StockChart/StockMarket? <stockmarket_state> <square_state name="G7"> <market_token company="B&O"/> <market_token company="NYC"/> </square_state> ... </stockmarket_state> As shown, we should translate funny characters ('&' becomes '&'). If this the only character to watch it's no problem, but to solve the general case we would need some existing package. Erik. |