|
From: Jan E. <ch...@in...> - 2001-09-28 08:44:50
|
Hi,
Mike asked a few days ago how destroyed units should be dealt with. There
are a few ways to do it that I'm aware of:
1. delete the unit entirely from all structures.
It's the easiest way, but we lose all ways of referring to the unit later.
It could be nice to be able to calculate losses and show them on the "end
game" screen. We'd also not know if any organization had lost any
companies.
2. move the destroyed units to a separate structure.
Also easy to handle, but needs some more code when serializing. I think we
must save destroyed units too when games are saved.
3. mark the unit as destroyed in the Unit class.
The flag must be manually honored everywhere, which means that very much
code must be altered and checked up. This is design-wise the cleanest
approach, but means most work.
Personally I advocate version 2. I can easily adapt the saving/loading
code to save the destroyed units and when loading automatically place them
in the "destroyed structure".
Speak up now or forever shut up... :)
--
Many an ancient lord's last words had been:
"You can't kill me because I've got magic aaargh...."
-- Terry Pratchett, Interesting Times
|