xoreos  0.0.5
Public Types | Public Member Functions | Private Attributes | List of all members
Aurora::NWScript::Variable Class Reference

#include <variable.h>

Collaboration diagram for Aurora::NWScript::Variable:
Collaboration graph
[legend]

Public Types

typedef std::vector< boost::shared_ptr< Variable > > Array
 

Public Member Functions

 Variable (Type type=kTypeVoid)
 
 Variable (int32 value)
 
 Variable (float value)
 
 Variable (const Common::UString &value)
 
 Variable (Object *value)
 
 Variable (const ObjectReference &value)
 
 Variable (const EngineType *value)
 
 Variable (const EngineType &value)
 
 Variable (float x, float y, float z)
 
 Variable (const Variable &var)
 
 ~Variable ()
 
void setType (Type type)
 
Variableoperator= (const Variable &var)
 
Variableoperator= (int32 value)
 
Variableoperator= (float value)
 
Variableoperator= (const Common::UString &value)
 
Variableoperator= (Object *value)
 
Variableoperator= (const ObjectReference &value)
 
Variableoperator= (const EngineType *value)
 
Variableoperator= (const EngineType &value)
 
bool operator== (const Variable &var) const
 
bool operator!= (const Variable &var) const
 
Type getType () const
 
int32 getInt () const
 
float getFloat () const
 
Common::UStringgetString ()
 
const Common::UStringgetString () const
 
ObjectgetObject () const
 
EngineTypegetEngineType () const
 
void setVector (float x, float y, float z)
 
void getVector (float &x, float &y, float &z) const
 
const ArraygetArray () const
 
ArraygetArray ()
 
size_t getArraySize () const
 
void growArray (Type type, size_t size)
 
ScriptStategetScriptState ()
 
const ScriptStategetScriptState () const
 
VariablegetReference () const
 
void setReference (Variable *reference)
 

Private Attributes

Type _type
 
union {
   int32   _int
 
   float   _float
 
   Common::UString *   _string
 
   ObjectReference *   _object
 
   float   _vector [3]
 
   ScriptState *   _scriptState
 
   EngineType *   _engineType
 
   Variable *   _reference
 
_value
 
boost::shared_ptr< Array_array
 

Detailed Description

Definition at line 56 of file variable.h.

Member Typedef Documentation

◆ Array

typedef std::vector< boost::shared_ptr<Variable> > Aurora::NWScript::Variable::Array

Definition at line 58 of file variable.h.

Constructor & Destructor Documentation

◆ Variable() [1/10]

Aurora::NWScript::Variable::Variable ( Type  type = kTypeVoid)

Definition at line 38 of file variable.cpp.

References setType().

Here is the call graph for this function:

◆ Variable() [2/10]

Aurora::NWScript::Variable::Variable ( int32  value)

Definition at line 42 of file variable.cpp.

References Aurora::NWScript::kTypeInt, and setType().

Here is the call graph for this function:

◆ Variable() [3/10]

Aurora::NWScript::Variable::Variable ( float  value)

Definition at line 48 of file variable.cpp.

References Aurora::NWScript::kTypeFloat, and setType().

Here is the call graph for this function:

◆ Variable() [4/10]

Aurora::NWScript::Variable::Variable ( const Common::UString value)

Definition at line 54 of file variable.cpp.

References Aurora::NWScript::kTypeString, and setType().

Here is the call graph for this function:

◆ Variable() [5/10]

Aurora::NWScript::Variable::Variable ( Object value)

Definition at line 60 of file variable.cpp.

References Aurora::NWScript::kTypeObject, and setType().

Here is the call graph for this function:

◆ Variable() [6/10]

Aurora::NWScript::Variable::Variable ( const ObjectReference value)

Definition at line 66 of file variable.cpp.

References Aurora::NWScript::kTypeObject, and setType().

Here is the call graph for this function:

◆ Variable() [7/10]

Aurora::NWScript::Variable::Variable ( const EngineType value)

Definition at line 72 of file variable.cpp.

References Aurora::NWScript::kTypeEngineType, and setType().

Here is the call graph for this function:

◆ Variable() [8/10]

Aurora::NWScript::Variable::Variable ( const EngineType value)

Definition at line 78 of file variable.cpp.

References Aurora::NWScript::kTypeEngineType, and setType().

Here is the call graph for this function:

◆ Variable() [9/10]

Aurora::NWScript::Variable::Variable ( float  x,
float  y,
float  z 
)

Definition at line 84 of file variable.cpp.

References Aurora::NWScript::kTypeVector, setType(), and setVector().

Here is the call graph for this function:

◆ Variable() [10/10]

Aurora::NWScript::Variable::Variable ( const Variable var)

Definition at line 90 of file variable.cpp.

◆ ~Variable()

Aurora::NWScript::Variable::~Variable ( )

Definition at line 94 of file variable.cpp.

References Aurora::NWScript::kTypeVoid, and setType().

Here is the call graph for this function:

Member Function Documentation

◆ getArray() [1/2]

const Variable::Array & Aurora::NWScript::Variable::getArray ( ) const

◆ getArray() [2/2]

Variable::Array & Aurora::NWScript::Variable::getArray ( )

Definition at line 362 of file variable.cpp.

References _array, _type, and Aurora::NWScript::kTypeArray.

◆ getArraySize()

size_t Aurora::NWScript::Variable::getArraySize ( ) const

Definition at line 371 of file variable.cpp.

References _array, _type, and Aurora::NWScript::kTypeArray.

◆ getEngineType()

EngineType * Aurora::NWScript::Variable::getEngineType ( ) const

◆ getFloat()

float Aurora::NWScript::Variable::getFloat ( ) const

◆ getInt()

int32 Aurora::NWScript::Variable::getInt ( ) const

Definition at line 293 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeInt.

Referenced by Aurora::NWScript::NCSFile::execute(), Aurora::NWScript::formatVariable(), Engines::Jade::Functions::getLocalBool(), Engines::KotOR2::Functions::getLocalBoolean(), Engines::KotOR::Functions::getLocalBoolean(), Engines::DragonAge2::Functions::getLocalInt(), Engines::Jade::Functions::getLocalInt(), Engines::KotOR2::Functions::getLocalNumber(), Engines::KotOR::Functions::getLocalNumber(), Aurora::NWScript::NCSFile::o_add(), Aurora::NWScript::NCSFile::o_booland(), Aurora::NWScript::NCSFile::o_comp(), Aurora::NWScript::NCSFile::o_decbp(), Aurora::NWScript::NCSFile::o_decsp(), Aurora::NWScript::NCSFile::o_div(), Aurora::NWScript::NCSFile::o_excor(), Aurora::NWScript::NCSFile::o_geq(), Aurora::NWScript::NCSFile::o_getrefarray(), Aurora::NWScript::NCSFile::o_gt(), Aurora::NWScript::NCSFile::o_incbp(), Aurora::NWScript::NCSFile::o_incor(), Aurora::NWScript::NCSFile::o_incsp(), Aurora::NWScript::NCSFile::o_jnz(), Aurora::NWScript::NCSFile::o_jz(), Aurora::NWScript::NCSFile::o_leq(), Aurora::NWScript::NCSFile::o_logand(), Aurora::NWScript::NCSFile::o_logor(), Aurora::NWScript::NCSFile::o_lt(), Aurora::NWScript::NCSFile::o_mod(), Aurora::NWScript::NCSFile::o_mul(), Aurora::NWScript::NCSFile::o_neg(), Aurora::NWScript::NCSFile::o_not(), Aurora::NWScript::NCSFile::o_readarray(), Aurora::NWScript::NCSFile::o_restorebp(), Aurora::NWScript::NCSFile::o_shleft(), Aurora::NWScript::NCSFile::o_shright(), Aurora::NWScript::NCSFile::o_sub(), Aurora::NWScript::NCSFile::o_ushright(), Aurora::NWScript::NCSFile::o_writearray(), Engines::NWN::ScriptContainer::runScript(), Engines::Jade::ScriptContainer::runScript(), Engines::NWN2::ScriptContainer::runScript(), Engines::Witcher::ScriptContainer::runScript(), Engines::KotOR2::ScriptContainer::runScript(), Engines::KotOR::ScriptContainer::runScript(), Engines::DragonAge2::ScriptContainer::runScript(), Engines::DragonAge::ScriptContainer::runScript(), and Aurora::DLGFile::runScript().

Here is the caller graph for this function:

◆ getObject()

Object * Aurora::NWScript::Variable::getObject ( ) const

Definition at line 321 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeObject.

Referenced by Aurora::NWScript::formatVariable(), Engines::DragonAge2::Functions::getLocalObject(), and Engines::Jade::Functions::getLocalObject().

Here is the caller graph for this function:

◆ getReference()

Variable * Aurora::NWScript::Variable::getReference ( ) const

Definition at line 408 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeReference.

Referenced by Aurora::NWScript::formatVariable().

Here is the caller graph for this function:

◆ getScriptState() [1/2]

ScriptState & Aurora::NWScript::Variable::getScriptState ( )

Definition at line 394 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeScriptState.

Referenced by Aurora::NWScript::NCSFile::callEngine(), and Aurora::NWScript::NCSFile::o_storestate().

Here is the caller graph for this function:

◆ getScriptState() [2/2]

const ScriptState & Aurora::NWScript::Variable::getScriptState ( ) const

Definition at line 401 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeScriptState.

◆ getString() [1/2]

Common::UString & Aurora::NWScript::Variable::getString ( )

Definition at line 314 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeString.

Referenced by Aurora::NWScript::formatVariable(), Engines::NWN::Functions::get2DAString(), Engines::NWN2::Functions::get2DAString(), Engines::Witcher::Functions::get2DAString(), Engines::DragonAge2::Functions::getLocalResource(), Engines::DragonAge2::Functions::getLocalString(), Engines::Jade::Functions::getLocalString(), Engines::Witcher::Functions::getName(), Engines::NWN::Functions::getName(), Engines::NWN2::Functions::getName(), Engines::DragonAge::Functions::getName(), Engines::DragonAge2::Functions::getName(), Engines::DragonAge::Functions::getResRef(), Engines::DragonAge2::Functions::getResRef(), Engines::KotOR2::Functions::getStringLeft(), Engines::NWN::Functions::getStringLeft(), Engines::NWN2::Functions::getStringLeft(), Engines::KotOR::Functions::getStringLeft(), Engines::Witcher::Functions::getStringLeft(), Engines::Jade::Functions::getStringLeft(), Engines::KotOR2::Functions::getStringRight(), Engines::NWN::Functions::getStringRight(), Engines::NWN2::Functions::getStringRight(), Engines::Witcher::Functions::getStringRight(), Engines::KotOR::Functions::getStringRight(), Engines::Jade::Functions::getStringRight(), Engines::KotOR2::Functions::getSubString(), Engines::NWN::Functions::getSubString(), Engines::NWN2::Functions::getSubString(), Engines::KotOR::Functions::getSubString(), Engines::Witcher::Functions::getSubString(), Engines::Jade::Functions::getSubString(), Engines::Witcher::Functions::getTag(), Engines::NWN::Functions::getTag(), Engines::Jade::Functions::getTag(), Engines::DragonAge::Functions::getTag(), Engines::NWN2::Functions::getTag(), Engines::DragonAge2::Functions::getTag(), Engines::KotOR2::Functions::insertString(), Engines::NWN::Functions::insertString(), Engines::NWN2::Functions::insertString(), Engines::KotOR::Functions::insertString(), Engines::Witcher::Functions::insertString(), Engines::Jade::Functions::insertString(), Engines::DragonAge::Functions::insertString(), Engines::DragonAge2::Functions::insertString(), Aurora::NWScript::NCSFile::o_add(), Engines::Witcher::Functions::printObject(), Engines::Witcher::Functions::printVector(), Engines::DragonAge::Functions::stringLeft(), Engines::DragonAge2::Functions::stringLeft(), Engines::DragonAge2::Functions::stringRight(), Engines::DragonAge::Functions::stringRight(), Engines::DragonAge::Functions::subString(), and Engines::DragonAge2::Functions::subString().

◆ getString() [2/2]

const Common::UString & Aurora::NWScript::Variable::getString ( ) const

Definition at line 307 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeString.

◆ getType()

Type Aurora::NWScript::Variable::getType ( ) const

◆ getVector()

void Aurora::NWScript::Variable::getVector ( float &  x,
float &  y,
float &  z 
) const

Definition at line 344 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeVector.

Referenced by Aurora::NWScript::NCSFile::callEngine(), and Aurora::NWScript::formatVariable().

Here is the caller graph for this function:

◆ growArray()

void Aurora::NWScript::Variable::growArray ( Type  type,
size_t  size 
)

Definition at line 380 of file variable.cpp.

References _array, _type, and Aurora::NWScript::kTypeArray.

Referenced by Aurora::NWScript::NCSFile::o_writearray().

Here is the caller graph for this function:

◆ operator!=()

bool Aurora::NWScript::Variable::operator!= ( const Variable var) const

Definition at line 285 of file variable.cpp.

◆ operator=() [1/8]

Variable & Aurora::NWScript::Variable::operator= ( const Variable var)

◆ operator=() [2/8]

Variable & Aurora::NWScript::Variable::operator= ( int32  value)

Definition at line 183 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeInt.

◆ operator=() [3/8]

Variable & Aurora::NWScript::Variable::operator= ( float  value)

Definition at line 192 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeFloat.

◆ operator=() [4/8]

Variable & Aurora::NWScript::Variable::operator= ( const Common::UString value)

Definition at line 201 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeString.

◆ operator=() [5/8]

Variable & Aurora::NWScript::Variable::operator= ( Object value)

Definition at line 210 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeObject.

◆ operator=() [6/8]

Variable & Aurora::NWScript::Variable::operator= ( const ObjectReference value)

Definition at line 219 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeObject.

◆ operator=() [7/8]

Variable & Aurora::NWScript::Variable::operator= ( const EngineType value)

Definition at line 228 of file variable.cpp.

References _type, _value, Aurora::NWScript::EngineType::clone(), and Aurora::NWScript::kTypeEngineType.

Here is the call graph for this function:

◆ operator=() [8/8]

Variable & Aurora::NWScript::Variable::operator= ( const EngineType value)

Definition at line 241 of file variable.cpp.

◆ operator==()

bool Aurora::NWScript::Variable::operator== ( const Variable var) const

◆ setReference()

void Aurora::NWScript::Variable::setReference ( Variable reference)

Definition at line 415 of file variable.cpp.

References _type, _value, and Aurora::NWScript::kTypeReference.

Referenced by Aurora::NWScript::NCSFile::o_getref(), and Aurora::NWScript::NCSFile::o_getrefarray().

Here is the caller graph for this function:

◆ setType()

void Aurora::NWScript::Variable::setType ( Type  type)

◆ setVector()

void Aurora::NWScript::Variable::setVector ( float  x,
float  y,
float  z 
)

Member Data Documentation

◆ _array

boost::shared_ptr<Array> Aurora::NWScript::Variable::_array
private

Definition at line 126 of file variable.h.

Referenced by getArray(), getArraySize(), growArray(), operator=(), operator==(), and setType().

◆ _engineType

EngineType* Aurora::NWScript::Variable::_engineType

Definition at line 122 of file variable.h.

Referenced by operator=().

◆ _float

float Aurora::NWScript::Variable::_float

Definition at line 117 of file variable.h.

Referenced by operator==().

◆ _int

int32 Aurora::NWScript::Variable::_int

Definition at line 116 of file variable.h.

Referenced by operator==().

◆ _object

ObjectReference* Aurora::NWScript::Variable::_object

Definition at line 119 of file variable.h.

Referenced by operator=(), and operator==().

◆ _reference

Variable* Aurora::NWScript::Variable::_reference

Definition at line 123 of file variable.h.

◆ _scriptState

ScriptState* Aurora::NWScript::Variable::_scriptState

Definition at line 121 of file variable.h.

Referenced by operator=().

◆ _string

Common::UString* Aurora::NWScript::Variable::_string

Definition at line 118 of file variable.h.

Referenced by operator=(), and operator==().

◆ _type

Type Aurora::NWScript::Variable::_type
private

◆ _value

union { ... } Aurora::NWScript::Variable::_value

◆ _vector

float Aurora::NWScript::Variable::_vector[3]

Definition at line 120 of file variable.h.

Referenced by operator==().


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