Talk:Data structures for the map

From RogueBasin
Revision as of 01:39, 30 March 2009 by Simonj (talk | contribs) (questioning methods)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

"So, there are lists of Objects, Items and Monsters on the given level. Every element of these lists must also store the position. Every time you want to know what items lie on given square, you have to iterate trough the list of all items and take the ones with proper position set. It might seem slow, but you won't have to do it often."

Why can't use pointers (or some sort of reference if in a non C language) to reference objects in our 2d array. Some of the coding is done a certain way to make it all fast, and then we have to scan through arrays to find all nearby objects and mobs.