|
From: Erik V. <eri...@hc...> - 2005-03-05 14:38:55
|
I absolutely agree.
StockChart now has a generic log method,
which is called by all move methods, and reads:
logMove(String companyName, StockPrice from, StockPrice to) {
if (to == null || from == to) {
System.out.println (companyName+" stays at
"+from.getName());
} else {
System.out.println (companyName+" moved from
"+from.getName()+" to "+to.getName());
}
}
where System.out will later be changed to a log file handle.
Erik.
> -----Original Message-----
> From: rai...@li...
> [mailto:rai...@li...] On Behalf Of
> John David Galt
> Sent: 05 March 2005 14:33
> To: rai...@li...
> Subject: Re: [Rails-devel] Stock market revisited
>
> Erik Vos wrote:
> > I was talking about objects reporting their state *changes*.
> > We need that to create a readable game log (e.g. for PBEM).
>
> I like this in principle. However, since money does not appear or
> disappear but goes somewhere, I suggest that all money movements be
> handled by a single function ("Transfer" with two arguments) and
> logged as a single action. If "add $30 to Player 1" and "subtract
> $30 from the Bank" are two separate actions, it's too easy for one
> to get done and the other skipped.
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from
> real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Rails-devel mailing list
> Rai...@li...
> https://lists.sourceforge.net/lists/listinfo/rails-devel
>
>
|