Theme Park Builder 3D The Game

Technical Design Document Coding Philosphy

Table of Contents

Storage and Data Management.

Role

Data persistance and management.

Dependencies

Libraries and Support code used.
XML - TinyXML is included by default, open source version.
JSON - Newer open source data representation format provided as open source.
BIN - Binary format with custom code (Optional)
zlib - compression library can BLOG pack any of the above formats
io.h - IO subsystem for low level reads/writes.

Synopsis

Data can be stored in any number of formats that we san serialize to. Serializarion is basically a smart data stream. On store, data is fed into the stream with tags that identify identifiers the data when it is later loaded. On load, the data is drawn out and fed back to the object manager which upon reading tags calls the proper create methods or factories to rebuild the objects from the data. Each object is responsible for what to do with that data. Objects must also validate the data and throw the proper exception for the problem that occurs. The data manager must capture and handle it's own exceptions includind the SerializeException.

Description

When you look at the source for the XML class, you will discover that it's quite small and not complex. A few methods are using delegates to allow the save and load methods a clean way to call back functions to build the tree. This serialization system allows the use of multiple storage system and almost never touch the main code.

Working with Serialization.
Building a new serializer.
Derive a new seialization class from SerializerBase.
Include the headers needed to support the storage and retrieval system you choose.
Override the Save and Load methods to use your new storage and retrieval library.
Override the child handling methods so heirarchial data methods work the game. Note the delegate(s) used.
Provide catches for exception handling, throw a DataException with an explicit error message when possible.

Copyright ©2010 Alabama Cajun for Theme Park Builder 3D Licensed under Creative Commons!