Hello :)
well... i need to do a simple thing (i guess) but it seems that this is not so simple due to all the complicating examples on the web...
ok. i jast wanna to create a copy of an object! but i want the copy to be seperate from the original, so when i change something in the copy it will not affect the original. in this case i need Shallow-Copy or Deep-Copy? i thought its a Deep-Copy until i saw an example that confused me...
now - how i implement it?
lets say i have this Class -
public class Position
{
private bool _Turn;
private AAAA _EN;
public bool Turn
{
get { return _Turn; }
set { _Turn = value; }
}
public AAAA EN
{
get { return _EN; }
set { _EN = value; }
}
this is when AAAA is a class too
well, i understand that i needed to add IClonable and Clone() Methode like that:
public class Position: IClonable
{
private bool _Turn;
private AAAA _EN;
public bool Turn
{
get { return _Turn; }
set { _Turn = value; }
}
public AAAA EN
{
get { return _EN; }
set { _EN = value; }
}
public Position Clone()
{
what in here??? i got confuse...
}
Hope u understand my question...
Thanks in advance