Thread: clone problem
View Single Post
  #13 (permalink)  
Old 01-12-2008, 09:58 PM
feniger feniger is offline
Member
 
Join Date: Dec 2007
Posts: 17
feniger is on a distinguished road
wowww
lots of replys while I havent been around!
anyway, the source of my problem was my lack of knowledge in cloning,
what I found out is that I have to clone EVERY type of Object withing the class/object I am cloning, which means if I have an object, that one of its fields (attributes) is not a primitive data type, but another object (for example: Square will have int row, int col, but also a PieceType pieceOnSquare)
then I'll have to clone pieceOnSquare as well,
when I found that out, I STILL had the same problem!! it didnt go away and it took me time to understand that in order to clone pieceOnSquare in a valid way,
I have to clone all the Object types inside THAT object,
which basically means that as long as I havent gotten down to the most primitive data types/enumarations, I have to clone manually every Object within its attributes,

I hope my explanation was clear enough,
if anyone has trouble understanding that, tell me, I'll try and rephrase it...

feniger
__________________
have a good one - Day I mean...
Reply With Quote