[gameprogrammer] Re: stl container
- From: Matthew Weigel <unique@xxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 29 Aug 2007 16:49:10 -0500
Roger D Vargas wrote:
> What i need is something like this:
> <unique id, non unique id, data>
> And the container should be able to return an iterator of all data for a
> certain non unique id. I have a hash map of entities, each one with its
> id, but I would also like to access a group of them located in the same
> place (map). Thats why I was thinking in some quick solution like that.
OK, so do something like
std::map<unique_key_type, data> Entities;
and
std::map<non_unique_key_type, std::list<unique_key_type> > EntsByLoc;
We do something like this - multiple maps, where most of the maps just
map to the unique key of a master map - to let us access the data from
multiple perspectives quickly.
--
Matthew Weigel
hacker
unique@xxxxxxxxxxx
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: stl container
- From: Dave Slutzkin
- References:
- [gameprogrammer] stl container
- From: Roger D Vargas
- [gameprogrammer] Re: stl container
- From: Matthew Weigel
- [gameprogrammer] Re: stl container
- From: Roger D Vargas
Other related posts:
- » [gameprogrammer] stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- » [gameprogrammer] Re: stl container
- [gameprogrammer] Re: stl container
- From: Dave Slutzkin
- [gameprogrammer] stl container
- From: Roger D Vargas
- [gameprogrammer] Re: stl container
- From: Matthew Weigel
- [gameprogrammer] Re: stl container
- From: Roger D Vargas