AngelScript
|
Path: /sdk/add_on/scriptany/
The any
type is a generic container that can hold any value. It is a reference type.
The type is registered with RegisterScriptAny(asIScriptEngine*)
.
class any { any(); any(? &in value);
void store(? &in value); void store(int64 &in value); void store(double &in value);
bool retrieve(? &out value) const; bool retrieve(int64 &out value) const; bool retrieve(double &out value) const; }
In the scripts it can be used as follows:
int value; obj object; obj @handle; any a,b,c; a.store(value); // store the value b.store(@handle); // store an object handle c.store(object); // store a copy of the object
a.retrieve(value); // retrieve the value b.retrieve(@handle); // retrieve the object handle c.retrieve(object); // retrieve a copy of the object
In C++ the type can be used as follows: