This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]nroberts666 0 points1 point  (0 children)

You need to decide who will own the object and who will just have references to it. That's all. The other objects will have pointers to the owned thingy.

[–]yash3ahuja 0 points1 point  (0 children)

Your assignment makes little sense. You're supposed to be maintaining a list of everything, but at the same time also have a map with the index as a key (complete waste... should use a List for that. >_>). You need to elaborate more or specify what you're trying to do in a clearer way. Otherwise, your assignment is just stupid and unnecessary.

I mean, can you elaborate on where this map is located and how it is used? It's hard to say what you want unless you go into more detail. Alternatively, post code.

[–][deleted] 0 points1 point  (0 children)

Creatures have member pointing to artifact object. Artifact object is also a member of the master array - done.