Planeshift
MathEnvironment Class Reference

A specific MathEnvironment to be used in a MathScript. More...

#include <mathscript.h>

Public Member Functions

void Define (const char *name, double value)
 define a regular variable in the environment More...
 
void Define (const char *name, iScriptableVar *obj)
 define an object variable in the environment More...
 
void Define (const char *name, const char *str)
 define a string variable in the environment More...
 
void DumpAllVars () const
 
iScriptableVarGetPointer (double id) const
 retrieve a pointer to a scriptable object based on it's id. More...
 
csString GetString (double id) const
 retrieve a string literal based on it's id. More...
 
double GetValue (iScriptableVar *p)
 retrieve an ID for a scriptable object. More...
 
double GetValue (const char *p)
 retrieve an ID for a string literal. More...
 
bool HasObject (iScriptableVar *p) const
 test whether we have an ID for an object. More...
 
bool HasString (const char *p) const
 test whether we have an ID for a string. More...
 
void InterpolateString (csString &str) const
 Perform string interpolation, i.e. replacing ${...} with the appropriate variable. More...
 
MathVarLookup (const char *name) const
 
 MathEnvironment ()
 
 MathEnvironment (const MathEnvironment *parent)
 
 ~MathEnvironment ()
 

Detailed Description

A specific MathEnvironment to be used in a MathScript.

This holds all currently defined variables in that environment and allows you to define/retrieve those.

Definition at line 188 of file mathscript.h.

Constructor & Destructor Documentation

MathEnvironment::MathEnvironment ( )
inline

Definition at line 212 of file mathscript.h.

MathEnvironment::MathEnvironment ( const MathEnvironment parent)
inline

Definition at line 217 of file mathscript.h.

MathEnvironment::~MathEnvironment ( )

Member Function Documentation

void MathEnvironment::Define ( const char *  name,
double  value 
)

define a regular variable in the environment

void MathEnvironment::Define ( const char *  name,
iScriptableVar obj 
)

define an object variable in the environment

void MathEnvironment::Define ( const char *  name,
const char *  str 
)

define a string variable in the environment

void MathEnvironment::DumpAllVars ( ) const
iScriptableVar* MathEnvironment::GetPointer ( double  id) const

retrieve a pointer to a scriptable object based on it's id.

csString MathEnvironment::GetString ( double  id) const

retrieve a string literal based on it's id.

double MathEnvironment::GetValue ( iScriptableVar p)

retrieve an ID for a scriptable object.

double MathEnvironment::GetValue ( const char *  p)

retrieve an ID for a string literal.

bool MathEnvironment::HasObject ( iScriptableVar p) const

test whether we have an ID for an object.

bool MathEnvironment::HasString ( const char *  p) const

test whether we have an ID for a string.

void MathEnvironment::InterpolateString ( csString &  str) const

Perform string interpolation, i.e. replacing ${...} with the appropriate variable.

MathVar* MathEnvironment::Lookup ( const char *  name) const

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