This is a fairly broad question, but for my own understanding, I decided that I would throw it there.
Can anyone recommend projects or, perhaps, even generally accepted design patterns for situations where it would be necessary to know different objects that know about each other?
To use people / community simulations as an analogy, what would be the best pattern when you have X-people objects, where X can dynamically increase / contract, and each person has an opinion or relationship to another object?
A thought outside the programming syntax, I could just have an X to X grid that represents each person’s relationship with each other (like, dislike, not found, etc.). I thought that basically it is implemented in the code as a separate object from each object, which was updated every time a new one was created, but it seemed like an absolutely not elegant solution. Does anyone have any advice?
Secondly, if I have collections of people, each of which has an “inventory” or objects that they carry, I thought I could create an inventory of each person as a member of a class list; this linked list will grow and shrink as objects that a person grows and shrinks.
People’s objects can be easily requested for their objects, which they carry, but I can’t find an effective way to do the opposite; that is, I want to be able to request an item and find which people have this item.
I read this QA: Game objects talking to each other .. but I'm not sure if it is fully applicable to my case.
Can anyone offer any advice?
Thanks!
- R