OpenMW
Public Member Functions | Private Member Functions | Private Attributes
MWScript::InterpreterContext Class Reference

#include <interpretercontext.hpp>

List of all members.

Public Member Functions

 InterpreterContext (MWScript::Locals *locals, MWWorld::Ptr reference)
 The ownership of locals is not transferred. 0-pointer allowed.
virtual int getLocalShort (int index) const
virtual int getLocalLong (int index) const
virtual float getLocalFloat (int index) const
virtual void setLocalShort (int index, int value)
virtual void setLocalLong (int index, int value)
virtual void setLocalFloat (int index, float value)
virtual void messageBox (const std::string &message, const std::vector< std::string > &buttons)
virtual void report (const std::string &message)
 By default echo via messageBox.
virtual bool menuMode ()
virtual int getGlobalShort (const std::string &name) const
virtual int getGlobalLong (const std::string &name) const
virtual float getGlobalFloat (const std::string &name) const
virtual void setGlobalShort (const std::string &name, int value)
virtual void setGlobalLong (const std::string &name, int value)
virtual void setGlobalFloat (const std::string &name, float value)
virtual std::vector< std::string > getGlobals () const
virtual char getGlobalType (const std::string &name) const
virtual std::string getActionBinding (const std::string &action) const
virtual std::string getNPCName () const
virtual std::string getNPCRace () const
virtual std::string getNPCClass () const
virtual std::string getNPCFaction () const
virtual std::string getNPCRank () const
virtual std::string getPCName () const
virtual std::string getPCRace () const
virtual std::string getPCClass () const
virtual std::string getPCRank () const
virtual std::string getPCNextRank () const
virtual int getPCBounty () const
virtual std::string getCurrentCellName () const
virtual bool isScriptRunning (const std::string &name) const
virtual void startScript (const std::string &name)
virtual void stopScript (const std::string &name)
virtual float getDistance (const std::string &name, const std::string &id="") const
bool hasBeenActivated (const MWWorld::Ptr &ptr)
bool hasActivationBeenHandled () const
void activate (const MWWorld::Ptr &ptr, boost::shared_ptr< MWWorld::Action > action)
void executeActivation ()
 Execute the action defined by the last activate call.
void clearActivation ()
 Discard the action defined by the last activate call.
virtual float getSecondsPassed () const
virtual bool isDisabled (const std::string &id="") const
virtual void enable (const std::string &id="")
virtual void disable (const std::string &id="")
virtual int getMemberShort (const std::string &id, const std::string &name) const
virtual int getMemberLong (const std::string &id, const std::string &name) const
virtual float getMemberFloat (const std::string &id, const std::string &name) const
virtual void setMemberShort (const std::string &id, const std::string &name, int value)
virtual void setMemberLong (const std::string &id, const std::string &name, int value)
virtual void setMemberFloat (const std::string &id, const std::string &name, float value)
MWWorld::Ptr getReference ()
 Reference, that the script is running from (can be empty)

Private Member Functions

MWWorld::Ptr getReference (const std::string &id, bool activeOnly)
const MWWorld::Ptr getReference (const std::string &id, bool activeOnly) const

Private Attributes

LocalsmLocals
MWWorld::Ptr mReference
MWWorld::Ptr mActivated
bool mActivationHandled
boost::shared_ptr
< MWWorld::Action
mAction

Constructor & Destructor Documentation

The ownership of locals is not transferred. 0-pointer allowed.


Member Function Documentation

void MWScript::InterpreterContext::activate ( const MWWorld::Ptr ptr,
boost::shared_ptr< MWWorld::Action action 
)

Store reference acted upon and action. The actual execution of the action does not take place here.

Discard the action defined by the last activate call.

void MWScript::InterpreterContext::disable ( const std::string &  id = "") [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::enable ( const std::string &  id = "") [virtual]

Implements Interpreter::Context.

Execute the action defined by the last activate call.

std::string MWScript::InterpreterContext::getActionBinding ( const std::string &  action) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getCurrentCellName ( ) const [virtual]

Implements Interpreter::Context.

float MWScript::InterpreterContext::getDistance ( const std::string &  name,
const std::string &  id = "" 
) const [virtual]

Implements Interpreter::Context.

float MWScript::InterpreterContext::getGlobalFloat ( const std::string &  name) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getGlobalLong ( const std::string &  name) const [virtual]

Implements Interpreter::Context.

std::vector< std::string > MWScript::InterpreterContext::getGlobals ( ) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getGlobalShort ( const std::string &  name) const [virtual]

Implements Interpreter::Context.

char MWScript::InterpreterContext::getGlobalType ( const std::string &  name) const [virtual]

Implements Interpreter::Context.

float MWScript::InterpreterContext::getLocalFloat ( int  index) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getLocalLong ( int  index) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getLocalShort ( int  index) const [virtual]

Implements Interpreter::Context.

float MWScript::InterpreterContext::getMemberFloat ( const std::string &  id,
const std::string &  name 
) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getMemberLong ( const std::string &  id,
const std::string &  name 
) const [virtual]

Implements Interpreter::Context.

int MWScript::InterpreterContext::getMemberShort ( const std::string &  id,
const std::string &  name 
) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getNPCClass ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getNPCFaction ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getNPCName ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getNPCRace ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getNPCRank ( ) const [virtual]

Implements Interpreter::Context.

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getPCClass ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getPCName ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getPCNextRank ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getPCRace ( ) const [virtual]

Implements Interpreter::Context.

std::string MWScript::InterpreterContext::getPCRank ( ) const [virtual]

Implements Interpreter::Context.

MWWorld::Ptr MWScript::InterpreterContext::getReference ( const std::string &  id,
bool  activeOnly 
) [private]
const MWWorld::Ptr MWScript::InterpreterContext::getReference ( const std::string &  id,
bool  activeOnly 
) const [private]

Reference, that the script is running from (can be empty)

Implements Interpreter::Context.

Attention:
Calling this function for the right reference will mark the action as been handled.
bool MWScript::InterpreterContext::isDisabled ( const std::string &  id = "") const [virtual]

Implements Interpreter::Context.

bool MWScript::InterpreterContext::isScriptRunning ( const std::string &  name) const [virtual]

Implements Interpreter::Context.

Implements Interpreter::Context.

void MWScript::InterpreterContext::messageBox ( const std::string &  message,
const std::vector< std::string > &  buttons 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::report ( const std::string &  message) [virtual]

By default echo via messageBox.

Implements Interpreter::Context.

Reimplemented in MWGui::ConsoleInterpreterContext.

void MWScript::InterpreterContext::setGlobalFloat ( const std::string &  name,
float  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setGlobalLong ( const std::string &  name,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setGlobalShort ( const std::string &  name,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setLocalFloat ( int  index,
float  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setLocalLong ( int  index,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setLocalShort ( int  index,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setMemberFloat ( const std::string &  id,
const std::string &  name,
float  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setMemberLong ( const std::string &  id,
const std::string &  name,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::setMemberShort ( const std::string &  id,
const std::string &  name,
int  value 
) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::startScript ( const std::string &  name) [virtual]

Implements Interpreter::Context.

void MWScript::InterpreterContext::stopScript ( const std::string &  name) [virtual]

Implements Interpreter::Context.


Member Data Documentation


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