Skip to content

Serialization Design

T145 edited this page Nov 5, 2018 · 3 revisions

Writing

A game object is saved as a string in an XML format using XML encoding extension helper methods.

string dataStr = gameObj.XmlSerializeToString();

Reading

Through these same helper methods, we can read back our object from the XML encoded string. By simply using the following call and assigning the returned, configured object to a variable, we'll have our old object back:

var gameObj = dataStr.XmlDeserializeFromString<GameObjType>();
Clone this wiki locally