OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MWScript::Locals Class Reference

#include <locals.hpp>

Collaboration diagram for MWScript::Locals:

Public Member Functions

 Locals ()
 
bool isEmpty () const
 
bool configure (const ESM::Script &script)
 
bool setVarByInt (const std::string &script, const std::string &var, int val)
 
bool hasVar (const std::string &script, const std::string &var)
 
int getIntVar (const std::string &script, const std::string &var)
 
float getFloatVar (const std::string &script, const std::string &var)
 
bool write (ESM::Locals &locals, const std::string &script) const
 
void read (const ESM::Locals &locals, const std::string &script)
 

Public Attributes

std::vector
< Interpreter::Type_Short
mShorts
 
std::vector
< Interpreter::Type_Integer
mLongs
 
std::vector
< Interpreter::Type_Float
mFloats
 

Private Member Functions

void ensure (const std::string &scriptName)
 

Private Attributes

bool mInitialised
 

Constructor & Destructor Documentation

MWScript::Locals::Locals ( )

Member Function Documentation

bool MWScript::Locals::configure ( const ESM::Script script)
Returns
Did the state of *this change from uninitialised to initialised?

Here is the call graph for this function:

Here is the caller graph for this function:

void MWScript::Locals::ensure ( const std::string &  scriptName)
private

Here is the call graph for this function:

Here is the caller graph for this function:

float MWScript::Locals::getFloatVar ( const std::string &  script,
const std::string &  var 
)

if var does not exist, returns 0

Note
var needs to be in lowercase
Locals will be automatically configured first, if necessary

Here is the call graph for this function:

Here is the caller graph for this function:

int MWScript::Locals::getIntVar ( const std::string &  script,
const std::string &  var 
)

if var does not exist, returns 0

Note
var needs to be in lowercase
Locals will be automatically configured first, if necessary

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWScript::Locals::hasVar ( const std::string &  script,
const std::string &  var 
)
Note
Locals will be automatically configured first, if necessary

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWScript::Locals::isEmpty ( ) const

Are there any locals?

Note
Will return false, if locals have not been configured yet.

Here is the caller graph for this function:

void MWScript::Locals::read ( const ESM::Locals locals,
const std::string &  script 
)
Note
Locals will be automatically configured first, if necessary
Todo:
write to log

Here is the call graph for this function:

bool MWScript::Locals::setVarByInt ( const std::string &  script,
const std::string &  var,
int  val 
)
Note
var needs to be in lowercase
Locals will be automatically configured first, if necessary

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWScript::Locals::write ( ESM::Locals locals,
const std::string &  script 
) const
Note
If locals have not been configured yet, no data is written.
Returns
Locals written?

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<Interpreter::Type_Float> MWScript::Locals::mFloats
bool MWScript::Locals::mInitialised
private
std::vector<Interpreter::Type_Integer> MWScript::Locals::mLongs
std::vector<Interpreter::Type_Short> MWScript::Locals::mShorts

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