Serializing data (to save and load it) should be easy. That’s what serialization is all about! In .NET it is really simple to serialize even quite complex networks of objects using the BinaryFormatter class. But the latest versions of .NET warn you that BinaryFormatter is insecure and suggest that you use some different type of serialization such as JSON.
It sounds easy. But it isn’t.
I’ll look at JSON in more detail in future videos. In this lesson, I want to explain what serialization is and how you can suppress the BinaryFormatter errors using the pragma:
#pragma warning disable SYSLIB0011
To follow this course, bookmark the Complete Course In Adventure Game Programming Playlist:
• Complete Course in Adventure Game Pro... Huw Collingbourne is author of The Little Book Of Adventure Game Programming In C#. Available from:
* Amazon (US)
amzn.to/33M6sQ4 * Amazon (UK)
amzn.to/2YtaBrj And also, The Little Java Book Of Adventure Game Programming. Available from:
* Amazon (US)
amzn.to/3gizI93 * Amazon (UK)
amzn.to/3mydF0e If you are eager to get working on your own adventure game, you can download Huw’s free game-writing code libraries, BIFF (the Bitwise Interactive Fiction Framework) from:
www.bitwisebooks.com/ Facebook:
www.facebook.com/CodeWithHuw
@robsonfaria3882
1 month ago
OMG you just saved my life!!! Greetings from Brazil! Thank you!!
|