From: Brett L. <wak...@ea...> - 2005-03-01 01:35:17
|
I like this. This is a great start. If you want to send me the visio file, I'd be happy to include it in CVS.= This would be a good start to developer documentation. ---Brett. *********** REPLY SEPARATOR *********** On 2/28/2005 at 11:43 PM Stewart Thain using wsr...@ho... declared: >Brett, > >As promised, you'll find atached my sketched out object model in UML for >the >core generic framework. Rather than try sending a Visio file, I'm sending >a >snapshot as a PNG file. > >A few explanatory words are probably called for. > >I've modelled "Bank", "Player" and "Company" as subclasses of a common >"Entity" class. This allows inherited code to take care of common >functionality and in particular relationships. "Stock" can be held by any >of >"Bank", "Player" or "Company" in some 18xx games. In 1841, IIRC, major >companies can even hold stock in other companies. This brings an >opportunity >to write very simple code for functionality like dividends: some >"payDividend" (with amount parameter) method on "Company" simply loops >round >all issued "Stock" (follows the "issues" relationship), calling a >"payDividend" method on each "Stock" object, which pays the correct amount= >(adjusted for percentage share) to the owning "Entity" (follows the >inverse >"owns" relationship). > >Similarly, all Stock trades can be implemented with a single method that >changes the owner. > >I've subclassed "Tile" into "VariableTile" and "FixedTile". My idea is >that >we represent all of the printed map hexes as instances of "FixedTile". >This >mean that they can all be drawn in GUI in the same way, and those printed >portions of the map that can have tokens placed on them, or upgraded in >later phases do not need to be treated as a special case. I've separated >the >"Tile" from the "Location", so that relationships with "Token" don't need >to >be adjusted when a tile is upgraded. > >The "Round" hierarchy hanging off "Game" is really just a placeholder. If >you want to keep an audit trail of player and company actions for future >analysis or replay, then this is where I would put it in the object model. > >I've split "Company" into "Major" and "Minor" because in some 18xx games, >they are governed by different rules. > >This is very much a first attempt at an object model. At this stage I've >concentrated on the objects themselves and their relationships. I have >made >no attempt to fill in each object's attributes and methods. > >If you have any questions please email me and I'll be happy to answer= them. > >cheers > >Stewart ********** REPLY SEPARATOR END ********** This message sent with 100% recycled electrons. |