I am confused as to what the
Code: Select all
protected override object ReadObject<T>
As an example, I have a Region class, and I am only interested in saving the data it contains: RegionID, RegionRect and LocationData.
When adding it as a supported type, this code snippet gets generated:
Code: Select all
protected override object ReadObject<T>(ES3Reader reader)
{
var instance = new Region();
ReadObject<T>(reader, instance);
return instance;
}
What I have been doing, and works, but very much feels like a workaround because of my lack of understanding, is creating a new, empty constructor,
Code: Select all
public Region()
{
}
How is this supposed to be used, could you give me some concrete example? Thank you!