The AbstractData class represents a standard foundation for all data objects in the engine. It implements the ISave, ILoad and IInvalidate interfaces and provides as standard API for serializing the data it contains via the CustomSerializeData() method.
The invalid flag allows you to quickly see if data has been changed on the data instance. This is used in conjunction with the Invalidate() and ResetValidation() methods. Use this flag in classes that have the potential to be expensive to update and need to be delayed before refreshing their data.
void CustomSerializedData ( StringBuilder sb )
A reference to a StringBuilder which is supplied by the SerializedData() method.
Use this method to add additional serialized string data to the supplied StringBuilder instance.
void DeserializeData ( Dictionary<String, Object> data )
A Dictionary with a string as the key and a generic object as the value.
The DeserializeData method allows you to pass in a Dictionary with a string as the key and a generic object for the value. This can be manually parsed to convert each key/value pair into data used to configure the class that implements this interface.
void Invalidate ( )
This method allows a clean way to set the invalid property to true signaling a change in the underlying data. This method could be overridden to provide additional logic when the AbstractData is invalidated.
void ResetValidation ( )
This method allows a clean way to reset the invalid property to false signaling underlying data had finished updating. This method could be overridden to provide additional logic when the AbstractData is done changing.
String SerializeData ( )
Use this method to create a new StringBuilder instance and wrap any custom serialized data by leveraging the CustomSerializedData() method.