Skip to main content
gamedev.net
🔒 Locked

Untitled

Started by paulecoyote 1 reply 150+ views
Original Post
paulecoyote
paulecoyote
my 2cents - in the world of databases you would handle a many to many relationship by adding another table inbetween that relates the two relationships [a] 1..* [connector table] *..1 assuming you have a unique id for both a and b, you just store both in the connector table. Sorted. Infact a quick nasty hack for that in code would be to use two hash table collections in code - one for list keyed by a and the other by b. An entry in the a hashtable would point to an array of pointers to b, and visa versa. As long as you made sure the objects in the hashtables cleaned themselves out of them (via the Observer pattern or something perhaps) you'ld be sorted. Either that or refactor your data.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
paulecoyote
paulecoyote
ooo doggy, that was supposed to be in reply to a post. Please close this thread mod!
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
MadKeithV
MadKeithV
You can delete your own posts - just click "edit" on the original post, check the "delete" box, and click "make modifications".
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.