Question by
particlesmash · Feb 02, 2019 at 09:36 PM ·
classclass objectclass instance
Way to copy a Class without copying the references?
I am trying to make a game of evolving simply creatures for a simple project. When each object is done simulating I take the fittest one and display it. I would like to make a copy of the initial creatures, which I have stored in a class. That way I have one copy running through the simulation and have the other waiting in case it is the fittest so I can display it running through the simulation. My problem is I can not make a copy of a class without having it be a reference to the class. I would like to make a value type copy but I don't know how. Structs don't work either because of the way I have it set up. If anyone could help me figure out this I would be very grateful. Thank you.
Comment