For about two weeks I have been attempting to find the best possible way to do 'List Linking'.
First let me explain what I am trying to do.
I am creating a tool to assist my team in adding various things into our game. My problem is that I can not find a solution to a problem that has plagued me.
Example:
Resources, Building Resources, are added to a List<> Object, one which is a constructed resource, IE made from other resources, Then, for the constructed resource, a struct containing the ID of the resource that is to be made, the id of each resource required to make it along with the amount needed are added to another List<> object. So far so good. Now comes the problem. If a resource is deleted, everything that uses an ID after that is messed up. Since the ID of each resource is figured using the index of the list, the IDs change, but not for the Construted resource List<> object as they have no way of knowing that anything changed.
Now, Resources are the tip of the iceburg, I have resource->subpart->part->Item.
Any ideas? I have thought of using the resource name to go through and fix the ids, but I would think that would lag.
First let me explain what I am trying to do.
I am creating a tool to assist my team in adding various things into our game. My problem is that I can not find a solution to a problem that has plagued me.
Example:
Resources, Building Resources, are added to a List<> Object, one which is a constructed resource, IE made from other resources, Then, for the constructed resource, a struct containing the ID of the resource that is to be made, the id of each resource required to make it along with the amount needed are added to another List<> object. So far so good. Now comes the problem. If a resource is deleted, everything that uses an ID after that is messed up. Since the ID of each resource is figured using the index of the list, the IDs change, but not for the Construted resource List<> object as they have no way of knowing that anything changed.
Now, Resources are the tip of the iceburg, I have resource->subpart->part->Item.
Any ideas? I have thought of using the resource name to go through and fix the ids, but I would think that would lag.