Quantcast
Channel: Questions in topic: "class instance"
Viewing all articles
Browse latest Browse all 131

Way to copy a Class without copying the references?

$
0
0
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.

Viewing all articles
Browse latest Browse all 131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>