Shannon V. OKeets
Posts: 22095
Joined: 5/19/2005 From: Honolulu, Hawaii Status: offline
|
Eventually we work our way around to solutions for these little things. ======================= This week I am gathering into one source code module the disparate pieces of code concerning DOW. Two days a go I had this epiphany about how game phases should be coded. Instead of having a simple variable record the current phase, there should be an entire 'Object' (as in object oriented programming) for each phase. Each phase/object should have initialization, process, and termination routines as well as associated variables just used during the phase. For the DOW Phase, there are subphases, so I added another routine for changing from one DOW subphase to the next. I have only implemented this structure for the DOW phase, though it is how it should be done for all the phases in the game. When I get around to the code for declaring Vichy France, I will apply the same structure (the Vichy France Phase has quite a few subphases). I don't know if it is worth the bother to transform all the phases into Objects - if the code works, I'll leave it alone. But when the code is confusing, this transformation into an Object certainly clarifies everything (that has been my experience with the DOW code).
_____________________________
Steve Perfection is an elusive goal.
|