Plasma Engine  2.0
Loading...
Searching...
No Matches
plWorldWriter Class Reference

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.
 
plStreamWriterGetStream () 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.
 

Detailed Description

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).

Member Function Documentation

◆ WriteComponentHandle()

void plWorldWriter::WriteComponentHandle ( const plComponentHandle & hComponent)

Writes the given component handle to the stream.

Note
If the handle belongs to a component that is not part of the serialized scene, e.g. an object that was excluded by a tag, this function will assert.

◆ WriteGameObjectHandle()

void plWorldWriter::WriteGameObjectHandle ( const plGameObjectHandle & hObject)

Writes the given game object handle to the stream.

Note
If the handle belongs to an object that is not part of the serialized scene, e.g. an object that was excluded by a tag, this function will assert.

◆ WriteWorld()

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.


The documentation for this class was generated from the following files: