ezEngine  Milestone 9
ezWorldWriter Class Reference

Stores an entire ezWorld in a stream. More...

#include <WorldWriter.h>

Public Member Functions

void WriteWorld (ezStreamWriter &stream, ezWorld &world, const ezTagSet *pExclude=nullptr)
 Writes all content in world to stream. More...
 
void WriteObjects (ezStreamWriter &stream, const ezDeque< const ezGameObject *> &rootObjects)
 Only writes the given root objects and all their children to the stream.
 
void WriteObjects (ezStreamWriter &stream, ezArrayPtr< const ezGameObject *> rootObjects)
 Only writes the given root objects and all their children to the stream.
 
void WriteGameObjectHandle (const ezGameObjectHandle &hObject)
 Writes the given game object handle to the stream. More...
 
void WriteComponentHandle (const ezComponentHandle &hComponent)
 Writes the given component handle to the stream. More...
 
ezStreamWriterGetStream () const
 Accesses the stream to which data is written. Use this in component serialization functions to write data to the stream.
 
const ezDeque< const ezGameObject * > & GetAllWrittenRootObjects () const
 Returns an array containing all game object pointers that were written to the stream as root objects.
 
const ezDeque< const ezGameObject * > & GetAllWrittenChildObjects () const
 Returns an array containing all game object pointers that were written to the stream as child objects.
 

Detailed Description

Stores an entire ezWorld 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 ezWorldWriter::WriteComponentHandle ( const ezComponentHandle 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 ezWorldWriter::WriteGameObjectHandle ( const ezGameObjectHandle 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 ezWorldWriter::WriteWorld ( ezStreamWriter stream,
ezWorld world,
const ezTagSet 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: