Game - Map data structures
nun at meyl.com
Mon Jun 21 19:33:56 CEST 2004
(news:b2o8d0t01m8p1n7e20mv1g1ffb2lb6hbta at 4ax.com) wrote:
> On 19 Jun 2004 02:43:06 GMT, sholden at flexal.cs.usyd.edu.au (Sam
> Holden) wrote:
>> Which imples to me that the water object has an armies list or
>> something hanging of it.
> Of course there's an army-list containing all the army objects in the
> game, but the plan was to make indexed links to this list from each
> tile containing one or more armies. That way, if a player clicks a
> tile the game knows which armies exists on that tile.
> If I didn't have such links, I'd have to search through the entire
> army list every time a tile is selected.
> I know this makes for redundant data, but it's the only way I could
> figure out how to avoid potiential performance issues when selecting
> tiles. However, if there's a better way to do this I'd be happy to
> know :)
If the number of armies is small enough (say 1000, to be on the safe side),
don't worry about performance.
> Thanks :)
> 0:) Innocence
More information about the Python-list