Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / object ID's, few questions

Author
Message
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Sep 2009 18:44
What is the best way to hold and keep track of your objects, I know DarkGDK has an integer ID system, does this mean that there is an array somewhere and the ID is the element number? or is it another structure and if so, what is the best structure for these kind of objects?

I ask as I am implementing something similar and I am thinking about using integer ID's for my collision boxes and holding them in an array as I thats all I have ever used.

One thing I dont understand is in GDK you can give objects any ID you like (5000, 12, 10000000 etc..), how are these stored and accessed?
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 2nd Sep 2009 19:01
I use a map in my plugins , make a class or struct to hold your info and you can call it using an int id .


chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Sep 2009 20:08
Chunks, thats how I will do it then.
Thanks for that, it was very helpful.
chunks chunks
17
Years of Service
User Offline
Joined: 2nd Jan 2007
Location: ackworth uk
Posted: 2nd Sep 2009 21:38
cool, try this link it explains stl containers in detail http://www.cplusplus.com/reference/stl/

chunks

nvidia geforce 9500gt + amd athlon 64
windows vista ultimate.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Sep 2009 22:21
Thanks for link, used similar structures in Java but not C++.

Just spent ages getting an example of how to loop through the map, sorted it now though.

Thanks again.

Login to post a reply

Server time is: 2024-11-20 15:34:37
Your offset time is: 2024-11-20 15:34:37