I come to you not really for help, but more for opinions / advice. It's not a code problem, just an organization thing I can't get out of my head!
So, for my project, i'm using a Component / Entity system, with messaging and listeners in each system. I've been doing my best to get all logic in systems aside from stuff like raw rendering code and all that fun stuff. Components only hold data, and events handle triggering interactions in each system for handling those events.
Now, for my objects ( entities ) in my game world, I'll create a class called GameWorld or Item, and all it does is hold it's entity ID, and some basic logic specific for that entity. ( For example, Items and it's base class have their own Use() function, since each item might be crazy specific in how it's used. )
Now, when storing these game objects, which is basically just the entity GUID wrapped in a class, possibly with minimal outside ( non-system ) functions for logic, would it make more sense to store them all in one big list, say, all Items in a vector of items in ItemSystem, or would I give the item class object to it's appropriate owner? ( By owner, I mean GameWorld or Inventory ).And, it doesn't always have to be one big list. Maybe, CharacterSystem might hold three lists, one list for FriendlyNPCs, one list for EnemyNPCs, and one more for NeutralNPCs.
Currently, i'm trying to keep them all in the one big list in each system, so I can keep as much data/logic related to that area ( Item logic in ItemSystem ) so that I can keep it as modulated as possible. Is this the wrong way to go about it? Is it more common to see objects held by their owners, instead of one long list?
Thanks for any advice ahead of time, as I tend to read forum replys on my phone on the go, and I NEVER type forum posts on a touch screen xD
This post has been edited by Mr_Fraggs: 16 April 2014 - 08:53 PM