Advertisement Jump to content


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


Object modelling.

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

Hi, I am designing a game and this is my first OO game. I am using java for this. It''s a trading game. I have a player object which holds all the information for the player. however the player holds a item object which has it''s own attributes and the player can hold more than one of these item objects. How would I go about increasing the amount of items ? or am I looking at this wrong and should I build in the amount of item objects the player can have and then just make changes to the blank item objects when the player gains a item? I hope this makes sense.

Share this post

Link to post
Share on other sites
Linked lists are good.

std::vector is good if you don''t need to insert/remove items from the middle of the list much.

Share this post

Link to post
Share on other sites
Original post by Themonkster
well vectors it is then.

A minor note: use the more recent ArrayList instead of the Vector class, as it has more standard behaviour to correspond with the rest of the collection classes.

Even better, construct an ArrayList, but access it via the abstract List interface - if you ever want to switch it with a LinkedList or other list type, you only need to change a single line of code

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!