[HELP] Single questions & Help Thread [n00b] (66)

40 Name: #!/usr/bin/anonymous : 2008-08-09 23:16 ID:xETlsF3q

Question: I was reading an article on data structures for maps in roguelikes, and this section confused me.

"You can use a 2d array of flags. Again, if you use ints, you can fit more than enough flags there. For start, let's have HAS_OBJECT, HAS_MONSTER and HAS_ITEM flags. Then you don't have to do lookups for every square -- only for the squares that really contain something, and these are pretty rare. Every time you add/remove anything form the square, you update the flags."

What do they mean by a "2d array of flags using ints"? Is each int an index number in a array of flags? Considering that you'd have to account for multiple flags, this seems unlikely. Can anyone help me figure this out?

Full article here: http://roguebasin.roguelikedevelopment.org/index.php?title=Data_structures_for_the_map

This thread has been closed. You cannot post in this thread any longer.