![]() |
Plasma Engine
2.0
|
Stores an entire plWorld in a stream. More...
#include <WorldWriter.h>
Public Member Functions | |
void | WriteWorld (plStreamWriter &inout_stream, plWorld &ref_world, const plTagSet *pExclude=nullptr) |
Writes all content in world to stream. | |
void | WriteObjects (plStreamWriter &inout_stream, const plDeque< const plGameObject * > &rootObjects) |
Only writes the given root objects and all their children to the stream. | |
void | WriteObjects (plStreamWriter &inout_stream, plArrayPtr< const plGameObject * > rootObjects) |
Only writes the given root objects and all their children to the stream. | |
void | WriteGameObjectHandle (const plGameObjectHandle &hObject) |
Writes the given game object handle to the stream. | |
void | WriteComponentHandle (const plComponentHandle &hComponent) |
Writes the given component handle to the stream. | |
plStreamWriter & | GetStream () const |
Accesses the stream to which data is written. Use this in component serialization functions to write data to the stream. | |
const plDeque< const plGameObject * > & | GetAllWrittenRootObjects () const |
Returns an array containing all game object pointers that were written to the stream as root objects. | |
const plDeque< const plGameObject * > & | GetAllWrittenChildObjects () const |
Returns an array containing all game object pointers that were written to the stream as child objects. | |
Stores an entire plWorld in a stream.
Used for exporting a world in binary form either as a level or as a prefab (though there is no difference). Can be used for saving a game, if the exact state of the world shall be stored (e.g. like in an FPS).
void plWorldWriter::WriteComponentHandle | ( | const plComponentHandle & | hComponent | ) |
Writes the given component handle to the stream.
void plWorldWriter::WriteGameObjectHandle | ( | const plGameObjectHandle & | hObject | ) |
Writes the given game object handle to the stream.
void plWorldWriter::WriteWorld | ( | plStreamWriter & | inout_stream, |
plWorld & | ref_world, | ||
const plTagSet * | pExclude = nullptr ) |
Writes all content in world to stream.
All game objects with tags that overlap with pExclude will be ignored.