Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SonShadowCat

Ways to do inventory?

This topic is 6031 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

at the moment i am working on a text tournament style game i was wondering how i should do my inventory should i use a linked list or array(s)? is there a better way of doing it? thx "Those who serve no purpose, have no purpose"

Share this post


Link to post
Share on other sites
Advertisement
I say used a link list. It''ll be more efficient when you''re constantly pulling items out and putting them back into the inventory.

R.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by SonShadowCat
at the moment i am working on a text tournament style game

i was wondering how i should do my inventory

should i use a linked list or array(s)?

is there a better way of doing it?



If you''re using C++, I''d recommend a deque (from the STL) all the really neat-o keen features of a list with all the array-style syntax you could ask for!

Share this post


Link to post
Share on other sites
Yeah.... since it''s a text game, you really don''t need to worry aout optimization, so you could use an array-based structure like a collection if you want. Then again, lists work great, and they are easy to implement with STL.

Share this post


Link to post
Share on other sites
the AP lost me there ....

i think i will work with linked lists, i havent really worked with them before so i can get some exp from using them now

"Those who serve no purpose, have no purpose"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!