struct IStreamPersist { };
IStreamPersist.h
This interface must be implemented by all objects that must be serialized through the network or file.
The main purpose of the serialization is reproduce the game remotely or saving and restoring.This mean that the object must not save everything but only what really need to be restored correctly.
virtual bool IsDirty() = 0;
True must be serialized, false the object didn't change.
Checks if the object must be synchronized since the last serialization.
virtual bool Load(CStream & stm, IScriptObject * pStream = NULL) = 0;
Parameters |
Description |
CStream & stm |
The stream class that store the bitstream. |
IScriptObject * pStream = NULL |
script wrapper for the stream(optional). |
True if succeeded,false failed.
Reads the object from a stream(file persistence).
CStream
virtual bool Read(CStream&) = 0;
Parameters |
Description |
stm |
The stream class that store the bitstream. |
True if succeeded,false failed.
Reads the object from a stream(network)
CStream
virtual bool Save(CStream & stm) = 0;
Parameters |
Description |
CStream & stm |
The stream class that will store the bitstream. |
True if succeeded,false failed
Serializes the object to a bitstream(file persistence)
CStream
virtual bool Write(CStream&) = 0;
Parameters |
Description |
stm |
the stream class that will store the bitstream |
True if succeded,false failed
Serializes the object to a bitstream(network)
CStream