From: Erik V. <eri...@hc...> - 2005-03-05 10:41:59
|
> >The StockChart moveXxxx() methods already write the moves to > System.out, > >if that is what you want. > >(I guess this will later be replaced by writing to a log). > > > > The reason I suggest using toString() is that this will allow > us to use it for many other things beyond simply testing the classes. > > For example, it's an easy way for us to gather reporting data > about the state of the game by using each objects toString() > method rather than polling every getFoo() method for every > property within the object. Well, you can always call toString(), but perhaps you mean to customise its output? Like what? I was talking about objects reporting their state *changes*. We need that to create a readable game log (e.g. for PBEM). Using toString() to report *current state* is fine with me. Erik. |