25 #include <boost/make_shared.hpp> 106 delete _value._engineType;
108 delete _value._scriptState;
118 _array = boost::make_shared<Array>();
212 throw Common::Exception(
"Can't assign an object value to a non-object variable");
221 throw Common::Exception(
"Can't assign an object value to a non-object variable");
230 throw Common::Exception(
"Can't assign an engine-type value to a non-engine-type variable");
234 delete _value._engineType;
236 _value._engineType = engineType;
286 return !(*
this == var);
330 throw Common::Exception(
"Can't get an engine-type value from a non-engine-type variable");
332 return _value._engineType;
386 if (!
_array->empty() && (*_array)[0].get() && (*_array)[0]->getType() != type)
390 while (
_array->size() < size)
396 throw Common::Exception(
"Can't get a script state value from a non-script-state variable");
398 return *
_value._scriptState;
403 throw Common::Exception(
"Can't get a script state value from a non-script-state variable");
405 return *
_value._scriptState;
410 throw Common::Exception(
"Can't get a reference value from a non-reference variable");
417 throw Common::Exception(
"Can't assign a reference value to a non-reference variable");
419 _value._reference = reference;
void setReference(Variable *reference)
std::vector< boost::shared_ptr< Variable > > Array
virtual EngineType * clone() const =0
Clone factory method.
A class holding an UTF-8 string.
boost::shared_ptr< Array > _array
void growArray(Type type, size_t size)
Exception that provides a stack of explanations.
ScriptState * _scriptState
void getVector(float &x, float &y, float &z) const
Basic exceptions to throw.
union Aurora::NWScript::Variable::@6 _value
EngineType * getEngineType() const
Object * getObject() const
size_t getArraySize() const
void setVector(float x, float y, float z)
Variable(Type type=kTypeVoid)
A reference/pointer to another variable.
bool operator==(const Variable &var) const
ScriptState & getScriptState()
ObjectReference * _object
Variable & operator=(const Variable &var)
bool operator!=(const Variable &var) const
Reference to an NWScript object.
"effect", "event", "location", "talent"...
const Array & getArray() const
Common::UString & getString()
Common::UString * _string
Variable * getReference() const