[quote name='The_Neverending_Loop' timestamp='1337787072' post='4942591']
It also depends on how frequently your accessing your data, if you have a hundred items that are only iterated thru once in a while like when the character is looking thru inventory then you have nothing to worry about. Now if that array is being accessed constantly lets say every render call for whatever reason then you might want to look at an alternate approach but even then depending on the actions preformed on the array it might not be an issue.
Like people previously said in this thread it all depends on what you need and what your doing so we would need more details.
I am going to want to access them during each render call. The inventory is always on screen.
Also, as Miklas said I could use XML or a database for storing my items. I suppose I will need to do some reading in regards to that if I'm to go with that approach, I'm not familiar with either of them, but willing to learn. What would be the advantage of one over the other?
Thanks
[/quote]
Well those are just methods of storage, like where the data will live and in what form which seems to be a completely different issue then the one u first stated. If the items are going to be always be displayed and constantly accessible and there will be 100 possible items, then there are no shortcut around, you might at times have to iterate through all 100, at which point a LinkedList is perfectly fine.
Dont worry to much either about it being efficient or not, optimizing your code should come after you already got something working. You might THINK your saving time or playing it smarter by trying to come up with efficient solutions before they become a problem, but thats exactly the issue you are trying to come up with solutions to problems that don't exist yet.
Once your game is completed you might not have any significant issues with speed, and if you do! I highly doubt a 100 item inventory is going to be the cause of it all. Long story short try not to worry to much about smaller things and try just focusing on the bigger picture, its the best thing you can do in the long run. I say just go with the LinkedList and have fun coding!