Jump to content
  • Advertisement
Sign in to follow this  
Marmin

disposing item in linked list, but not immediately

This topic is 4696 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've a bunch of 'enemies' in a linked list, and when they are shot they must be disposed of. So I search in the list and adjust the list accordingly. But now a problem arises, I need to let the enemy 'live' for a while, but I want to dispose the enemy somewhat later, without searching the list again. How can I solve this problem. Do i need to set a pointer to that pointer in the list? And dispose this pointer later. yuk, getting complicated.

Share this post


Link to post
Share on other sites
Advertisement
have a second list.
remove "dead" creatures from the first list, insert them into the second list.
then you can delete them from the second list when youare done with them

Share this post


Link to post
Share on other sites
Quote:
Original post by KulSeran
have a second list.
remove "dead" creatures from the first list, insert them into the second list.
then you can delete them from the second list when youare done with them
Ditto. Take them out of your main list and put them on death row[grin]

[Edited by - iMalc on October 5, 2005 8:38:58 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!