Ability: reconstruct

Description:

This ability is used for objects that can reconstruct their state.

The function query_reconstruct returns whatever data is needed for its successful reconstruction of the object. The function reconstruct can reconstruct the object from data that query_reconstruct previously returned.

This ability is mainly used for the so called auto-load objects. It is similar to the ability saveable.

Note that an object which has this ability must define the functions query_reconstruct and reconstruct, since only the object knows how to properly reconstruct itself. The intended usage is as follows:

mixed r;

r = ob->request_reconstruct();
destruct(ob);

...

ob = clone_object(some_file);
ob->reconstruct(r);

Usage:

#include <ability.h>

inherit RECONSTRUCT;

Functions:

mixed query_reconstruct()
Return data that describes the object.

void reconstruct(mixed r)
Reconstruct the object from data r that was previously returned by query_reconstruct.

Source code:

/ability/reconstruct.c.

See also:

Ability: saveable