Hi,
I have a List of GameObjects, some GameObjects are associated with other GameObjects and the association is stored as a List within the class.
I am trying to work out if there is a way to remove GameObjects from the list so that in the end there is only a list of GameObjects that are not associated with each other, while removing as few GameObjects as possible.
My thoughts are to start with the GameObject that has the most associations, and work on from there.
Here is an example of the GameObject associations:
GAMEOBJECT NUMBER [Other GameObjects Associated with this one]
GameObject1 [GameObject2, GameObject4, GameObject5, GameObject6]
GameObject2 [GameObject1, GameObject4]
GameObject3 [GameObject5, GameObject6]
GameObject4 [GameObject1, GameObject6]
GameObject5 [GameObject1, GameObject3]
GameObject6 [GameObject1, GameObject3, GameObject4]
GameObject7 [null]
Example of the List construction:
var listOfGameObjects = List.<CollectionOfObjects>();
class CollectionOfObjects
{
var thisGameObject : GameObject;
var associatedGameObjects = List.<GameObject>();
var totalNumberOfAssociations : int;
}
Is this kind of sorting even possible? Thanks!