Archived

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

SonShadowCat

Ways to do inventory?

Recommended Posts

SonShadowCat    122
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
Rube    122
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   
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
Forcas    181
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
SonShadowCat    122
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