I\'ve got a Tile
class with this method:
public object Clone()
{
return MemberwiseClone();
}
And another class
Yes, MemberwiseClone will also copy the Checker
-only fields. MemberwiseClone cannot know the return type of your Clone
method; therefore, it's behaviour cannot depend on it.
About the difference betweeen your Clone implementation and the serialization: MemberwiseClone
creates a shallow copy of the Tiles: If a Tile (or Checker) references some object, the Tile's clone still references the same object (rather than a copy of it).
On the other hand, your serialization code is a well known practice for creating a deep copy of your board: The whole tree of dependent objects is serialized and deserialized.
Of course, this only makes a difference if your Tiles (or Checkers) contain fields with reference types.