Loading...
Searching...
No Matches
CBot::CBotVar Class Reference

A CBot variable. More...

`#include <src/CBot/CBotVar/CBotVar.h>`

Inheritance diagram for CBot::CBotVar:
[legend]

## Variable name and type

enum class | GetTypeMode { NORMAL = 0 , CLASS_AS_POINTER = 1 , CLASS_AS_INTRINSIC = 2 }
| Mode for GetType() and GetTypResult(). More...
const std::string & | GetName ()
| Returns the name of the variable.
void | SetName (const std::string &name)
| SetName Changes the name of the variable.
CBotToken * | GetToken ()
| Returns the CBotToken this variable is associated with.
CBotType | GetType (GetTypeMode mode=GetTypeMode::NORMAL) const
| GetType Returns the base type of the variable (::CBotType).
CBotTypResult | GetTypResult (GetTypeMode mode=GetTypeMode::NORMAL)
| Returns the complete type of the variable (CBotTypResult).
void | SetType (CBotTypResult &type)
| Change type of this variable.
virtual void | SetClass (CBotClass *pClass)
| Set class this variable is instance of.
virtual CBotClass * | GetClass ()
| Return class this variable is instance of.

## Initialization status

enum class | InitType : int { UNDEF = 0 , DEF = 1 , IS_POINTER = 2 }
| Variable initialization status. More...
void | SetInit (InitType initType)
| Changes variable init status.
InitType | GetInit () const
| Returns the current init state of the variable.
bool | IsUndefined () const
| Checks if the variable is currently "undefined".
bool | IsDefined () const
| Checks if the variable is currently "defined".

## Class member properties

enum class | ProtectionLevel { Public = 0 , ReadOnly = 1 , Protected = 2 , Private = 3 }
| Class member protection level (public/protected/private). More...
void | SetStatic (bool bStatic)
| Marks the variable as "static".
bool | IsStatic ()
| Checks if the variable is static.
void | SetPrivate (ProtectionLevel mPrivate)
| Sets variable protection level.
bool | IsPrivate (ProtectionLevel level=ProtectionLevel::Protected)
| Checks if the variable is accessible at the given protection level.
ProtectionLevel | GetPrivate ()
| Get variable protection level.
bool | IsElemOfClass (const std::string &name)
| Check if a variable belongs to a class with a given name.
virtual void | ConstructorSet ()
| Called after constructor has been called.
CBotVar * | GetStaticVar ()
| If this is a static class variable, return the static var from the class.
virtual void | Update (void *pUser)
| Call the class update function.
void | SetUniqNum (long n)
| Set unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem.
long | GetUniqNum ()
| Return unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem.
static long | NextUniqNum ()
| Generate next unique identifier.

## Save / restore state

CBotToken *const | m_token
| The corresponding token, defines the variable name.
CBotTypResult | m_type
| Type of value.
InitType | m_binit
| Initialization status.
CBotVarClass * | m_pMyThis
| Corresponding this element (TODO: ?).
void * | m_pUserPtr
| User pointer if specified.
bool | m_bStatic
| true if the variable is static (for classes)
ProtectionLevel | m_mPrivate
| Element protection level - public, protected or private (for classes).
CBotInstr * | m_InitExpr
| Expression describing initial value.
CBotInstr * | m_LimExpr
| Expression describing array limit.
long | m_ident
| Identifier.
static long | m_identcpt = 0
| TODO: ?
class | CBotStack
| The corresponding token, defines the variable name.
class | CBotCStack
| The corresponding token, defines the variable name.
class | CBotInstrCall
| The corresponding token, defines the variable name.
class | CBotProgram
| The corresponding token, defines the variable name.
class | CBotClass
| The corresponding token, defines the variable name.
class | CBotVarClass
| The corresponding token, defines the variable name.
class | CBotVarPointer
| The corresponding token, defines the variable name.
class | CBotVarArray
| The corresponding token, defines the variable name.
virtual bool | Save0State (std::ostream &ostr)
| Save common variable header (name, type, etc.).
virtual bool | Save1State (std::ostream &ostr)
| Save variable data.
static bool | RestoreState (std::istream &istr, CBotVar *&pVar)
| Restore variable.

## Creation / destruction

| CBotVar ()
| Constructor. Do not call directly, use CBotVar::Create().
| CBotVar (const CBotToken &name)
| Constructor. Do not call directly, use CBotVar::Create().
virtual | ~CBotVar ()
| Destructor. Do not call directly, use CBotVar::Destroy().
virtual void | SetIdent (long UniqId)
| Associates an unique identifier to class instance.
static CBotVar * | Create (const std::string &name, CBotTypResult type)
| Creates a new variable from a type described by CBotTypResult.
static CBotVar * | Create (const std::string &name, CBotClass *pClass)
| Creates a new variable of a given class type.
static CBotVar * | Create (const CBotToken &name, CBotType type)
| Creates a new variable of a given type.
static CBotVar * | Create (const CBotToken &name, CBotTypResult type)
| Create a new variable of a given type described by CBotTypResult.
static CBotVar * | Create (const std::string &name, CBotType type, CBotClass *pClass)
| Create a new variable of a given type of given class instance.
static CBotVar * | Create (CBotVar *pVar)
| Create a new variable of the same type and name as another one.
static void | Destroy (CBotVar *var)
| Destroy a variable.

## User pointer

void | SetUserPtr (void *pUser)
| Set a custom pointer associated with this variable.
void * | GetUserPtr ()
| Returns the custom pointer associated with this variable.

## Class / array member access

virtual CBotVar * | GetItem (const std::string &name)
| Returns class member by name.
virtual CBotVar * | GetItemRef (int nIdent)
| Returns class member by unique ID.
virtual CBotVar * | GetItem (int index, bool grow=false)
| Returns element of the array by index.
virtual CBotVar * | GetItemList ()
| Return all elements of this variable as a linked list. Works for both classes and arrays.

## Value management

Always make sure that the variable has correct type before calling these functions! Some variable types have multiple getters/setters and do automatic conversion. Using one that is not implemented will result in a failed assertion.
| operator bool ()
| Set the value.
| operator signed char ()
| Set the value.
| operator short ()
| Set the value.
| operator uint32_t ()
| Set the value.
| operator int ()
| Set the value.
| operator long ()
| Set the value.
| operator float ()
| Set the value.
| operator double ()
| Set the value.
| operator std::string ()
| Set the value.
void | operator= (const CBotVar &var)
| Set the value.
void | operator= (signed char x)
| Set the value.
void | operator= (short x)
| Set the value.
void | operator= (uint32_t x)
| Set the value.
void | operator= (int x)
| Set the value.
void | operator= (long x)
| Set the value.
void | operator= (float x)
| Set the value.
void | operator= (double x)
| Set the value.
void | operator= (const std::string &x)
| Set the value.
void | SetVal (CBotVar *var)
| Set the value.
virtual void | Copy (CBotVar *pSrc, bool bName=true)
| Copy from another variable.
virtual void | SetValByte (signed char val)
| Set the value.
virtual void | SetValShort (short val)
| Set the value.
virtual void | SetValChar (uint32_t val)
| Set the value.
virtual void | SetValInt (int val, const std::string &name="")
| Set value as an integer.
virtual void | SetValLong (long val)
| Set the value.
virtual void | SetValFloat (float val)
| Set value as float.
virtual void | SetValDouble (double val)
| Set the value.
virtual void | SetValString (const std::string &val)
| Set value as string.
virtual signed char | GetValByte () const
| Set the value.
virtual short | GetValShort () const
| Set the value.
virtual uint32_t | GetValChar () const
| Set the value.
virtual int | GetValInt () const
| Get value as integer.
virtual long | GetValLong () const
| Set the value.
virtual float | GetValFloat () const
| Get value as float.
virtual double | GetValDouble () const
| Set the value.
virtual std::string | GetValString () const
| Get value as string.
virtual void | SetPointer (CBotVar *p)
| Set value for pointer types.
virtual CBotVarClass * | GetPointer ()
| Get value for pointer types.

## Math operations

All these functions operate on the "left" variable, taking "right" as the argument. The C++ equivalent would be the +=, -=, *=, /= etc. operations
virtual void | Add (CBotVar *left, CBotVar *right)
| Addition.
virtual void | Sub (CBotVar *left, CBotVar *right)
| Subtraction.
virtual void | Mul (CBotVar *left, CBotVar *right)
| Multiplication.
virtual CBotError | Div (CBotVar *left, CBotVar *right)
| Division.
virtual CBotError | Modulo (CBotVar *left, CBotVar *right)
| Modulo (remainder of division).
virtual void | Power (CBotVar *left, CBotVar *right)
| Power.

## Comparation functions

virtual bool | Lo (CBotVar *left, CBotVar *right)
| left < right
virtual bool | Hi (CBotVar *left, CBotVar *right)
| left > right
virtual bool | Ls (CBotVar *left, CBotVar *right)
| left <= right
virtual bool | Hs (CBotVar *left, CBotVar *right)
| left >= right
virtual bool | Eq (CBotVar *left, CBotVar *right)
| left == right
virtual bool | Ne (CBotVar *left, CBotVar *right)
| left != right

## Logical or bitwise functions

Can be either depending on variable type. For boolean, those are logical functions, for int they are bitwise.
virtual void | And (CBotVar *left, CBotVar *right)
| left && right or left & right
virtual void | Or (CBotVar *left, CBotVar *right)
| left || right or left | right
virtual void | XOr (CBotVar *left, CBotVar *right)
| left ^ right (also for boolean!)
virtual void | Not ()
| !this or ~this

## Bitwise shift

virtual void | ASR (CBotVar *left, CBotVar *right)
| left >> right
virtual void | SR (CBotVar *left, CBotVar *right)
| left >>> right
virtual void | SL (CBotVar *left, CBotVar *right)
| left << right

## Negation / increment / decrement

virtual void | Neg ()
| -this
virtual void | Inc ()
| ++this
virtual void | Dec ()
| –this

## Additional Inherited Members

Public Member Functions inherited from CBot::CBotLinkedList< CBotVar >
virtual | ~CBotLinkedList ()
| Destructor. Be careful, destroys the whole linked list!
CBotVar * | GetNext ()
| Returns the next variable in the linked list.
void | AddNext (CBotVar *elem)
| Appends a new element at the end of the linked list.
Protected Attributes inherited from CBot::CBotLinkedList< CBotVar >
CBotVar * | m_next

## Detailed Description

A CBot variable.

## Member Enumeration Documentation

## GetTypeMode

enum class CBot::CBotVar::GetTypeMode

strong

Mode for GetType() and GetTypResult().

## InitType

enum class CBot::CBotVar::InitType : int

strong

Variable initialization status.

See also
  GetInit()

Enumerator
UNDEF | the variable value is currently not defined
DEF | the variable value is defined
IS_POINTER | the variable value is as a pointer

## ProtectionLevel

enum class CBot::CBotVar::ProtectionLevel

strong

Class member protection level (public/protected/private).

Enumerator
Public | public variable
ReadOnly | read only (can't be set from CBot, only from the engine)
Protected | protected
Private | private

## Constructor & Destructor Documentation

## CBotVar() [1/2]

CBot::CBotVar::CBotVar | ( |  | ) |

Constructor. Do not call directly, use CBotVar::Create().

## CBotVar() [2/2]

CBot::CBotVar::CBotVar | ( | const CBotToken & | name | ) |

Constructor. Do not call directly, use CBotVar::Create().

## ~CBotVar()

CBot::CBotVar::~CBotVar | ( |  | ) |

virtual

Destructor. Do not call directly, use CBotVar::Destroy().

## Member Function Documentation

## Create() [1/6]

CBotVar * CBot::CBotVar::Create | ( | const std::string & | name,
|  | CBotTypResult | type )

static

Creates a new variable from a type described by CBotTypResult.

Parameters

  name | Variable name
  type | Variable type

## Create() [2/6]

CBotVar * CBot::CBotVar::Create | ( | const std::string & | name,
|  | CBotClass * | pClass )

static

Creates a new variable of a given class type.

This is equivalent to:

CBotVar::Create(name, CBotTypResult(CBotTypClass, pClass))
CBot::CBotTypResult
Class to define the complete type of a variable.
Definition CBotTypResult.h:48
CBot::CBotVar::Create
static CBotVar * Create(const std::string &name, CBotTypResult type)
Creates a new variable from a type described by CBotTypResult.
Definition CBotVar.cpp:234
CBot::CBotTypClass
@ CBotTypClass
Class instance.
Definition CBotEnums.h:53

Parameters

  name | Variable name
  pClass | Class type

## Create() [3/6]

CBotVar * CBot::CBotVar::Create | ( | const CBotToken & | name,
|  | CBotType | type )

static

Creates a new variable of a given type.

This is equivalent to:

CBotVar::Create(name, CBotTypResult(type))

Parameters

  name | Variable name token
  type | Variable type

## Create() [4/6]

CBotVar * CBot::CBotVar::Create | ( | const CBotToken & | name,
|  | CBotTypResult | type )

static

Create a new variable of a given type described by CBotTypResult.

Parameters

  name | Variable name token
  type | Variable type

## Create() [5/6]

CBotVar * CBot::CBotVar::Create | ( | const std::string & | name,
|  | CBotType | type,
|  | CBotClass * | pClass )

static

Create a new variable of a given type of given class instance.

This is equivalent to:

Create(name, CBotTypResult(type, pClass))

Parameters

  name | Variable name
  type | Variable type
  pClass | Class

Returns

## Create() [6/6]

CBotVar * CBot::CBotVar::Create | ( | CBotVar * | pVar | ) |

static

Create a new variable of the same type and name as another one.

Contents of the variable are NOT copied.

Parameters

  pVar | other variable to take type and name from

## Destroy()

void CBot::CBotVar::Destroy | ( | CBotVar * | var | ) |

static

Destroy a variable.

Parameters

  var | variable to be destroyed

## SetIdent()

void CBot::CBotVar::SetIdent | ( | long | UniqId | ) |

virtual

Associates an unique identifier to class instance.

Used only by classes

Parameters

  UniqId | New unique identifier

See also
  SetUniqNum() for another identifier, used for all variable types

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## SetUserPtr()

void CBot::CBotVar::SetUserPtr | ( | void * | pUser | ) |

Set a custom pointer associated with this variable.

Parameters

  pUser | custom pointer to set

## GetUserPtr()

void * CBot::CBotVar::GetUserPtr | ( |  | ) |

Returns the custom pointer associated with this variable.

Returns
  A pointer set with SetUserPtr()

## GetName()

const std::string & CBot::CBotVar::GetName | ( |  | ) |

Returns the name of the variable.

Returns
  The name of the variable, empty string if unknown

## SetName()

void CBot::CBotVar::SetName | ( | const std::string & | name | ) |

SetName Changes the name of the variable.

Parameters

  name | New name

## GetToken()

CBotToken * CBot::CBotVar::GetToken | ( |  | ) |

Returns the CBotToken this variable is associated with.

This token is either passed in CBotVar::Create() or created from name string

## GetType()

CBotType CBot::CBotVar::GetType | ( | GetTypeMode | mode = GetTypeMode::NORMAL | ) | const

GetType Returns the base type of the variable (::CBotType).

Parameters

  mode | Mode, see GetTypeMode enum

## GetTypResult()

CBotTypResult CBot::CBotVar::GetTypResult | ( | GetTypeMode | mode = GetTypeMode::NORMAL | ) |

Returns the complete type of the variable (CBotTypResult).

Parameters

  mode | Mode, see GetTypeMode enum

## SetType()

void CBot::CBotVar::SetType | ( | CBotTypResult & | type | ) |

Change type of this variable.

Parameters

  type | new type

## SetClass()

void CBot::CBotVar::SetClass | ( | CBotClass * | pClass | ) |

virtual

Set class this variable is instance of.

Used by instance variables, NOT class members

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## GetClass()

CBotClass * CBot::CBotVar::GetClass | ( |  | ) |

virtual

Return class this variable is instance of.

Used by instance variables, NOT class members

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## SetInit()

void CBot::CBotVar::SetInit | ( | CBotVar::InitType | initType | ) |

Changes variable init status.

Parameters

  initType | New init status

## GetInit()

CBotVar::InitType CBot::CBotVar::GetInit | ( |  | ) | const

Returns the current init state of the variable.

## IsUndefined()

bool CBot::CBotVar::IsUndefined | ( |  | ) | const

inline

Checks if the variable is currently "undefined".

See also
  InitType::UNDEF

## IsDefined()

bool CBot::CBotVar::IsDefined | ( |  | ) | const

inline

Checks if the variable is currently "defined".

See also
  InitType::DEF

## SetStatic()

void CBot::CBotVar::SetStatic | ( | bool | bStatic | ) |

Marks the variable as "static".

Useful only for class members

Parameters

  bStatic | static or not

## IsStatic()

bool CBot::CBotVar::IsStatic | ( |  | ) |

Checks if the variable is static.

Useful only for class members

Returns
  true for static variables

## SetPrivate()

void CBot::CBotVar::SetPrivate | ( | ProtectionLevel | mPrivate | ) |

Sets variable protection level.

Useful only for class members

Parameters

  mPrivate | New protection level

## IsPrivate()

bool CBot::CBotVar::IsPrivate | ( | ProtectionLevel | level = ProtectionLevel::Protected | ) |

Checks if the variable is accessible at the given protection level.

This means that the variable protection level is greater or equal to given level

Parameters

  level | Protection level to check access at

## GetPrivate()

CBotVar::ProtectionLevel CBot::CBotVar::GetPrivate | ( |  | ) |

Get variable protection level.

Returns
  Variable protection level

## IsElemOfClass()

bool CBot::CBotVar::IsElemOfClass | ( | const std::string & | name | ) |

Check if a variable belongs to a class with a given name.

Works correctly with inheritance.

Parameters

  name | Class name to check

Returns
  true if this variable name matches any member of given class or any of the parent classes

## ConstructorSet()

void CBot::CBotVar::ConstructorSet | ( |  | ) |

virtual

Called after constructor has been called.

This is used internally by the engine to mark the constructor as called.

This allows the destructor to be called later.

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## GetStaticVar()

CBotVar * CBot::CBotVar::GetStaticVar | ( |  | ) |

If this is a static class variable, return the static var from the class.

Returns
  Static variable from CBotClass instance if this variable is static, or this otherwise

## Update()

void CBot::CBotVar::Update | ( | void * | pUser | ) |

virtual

Call the class update function.

Parameters

  pUser | User pointer to pass to the update function

See also
  CBotClass::SetUpdateFunc()

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## SetUniqNum()

void CBot::CBotVar::SetUniqNum | ( | long | n | ) |

Set unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem.

Parameters

  n | New identifier

## GetUniqNum()

long CBot::CBotVar::GetUniqNum | ( |  | ) |

Return unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem.

Returns
  unique identifier

See also
  SetUniqNum()

## NextUniqNum()

long CBot::CBotVar::NextUniqNum | ( |  | ) |

static

Generate next unique identifier.

Used by both variables (CBotVar) and functions (CBotFunction)

## GetItem() [1/2]

CBotVar * CBot::CBotVar::GetItem | ( | const std::string & | name | ) |

virtual

Returns class member by name.

Parameters

  name | Name of member to get

Returns
  CBotVar representing the class member

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## GetItemRef()

CBotVar * CBot::CBotVar::GetItemRef | ( | int | nIdent | ) |

virtual

Returns class member by unique ID.

Parameters

  nIdent | Unique ID of the class member to return

Returns
  CBotVar representing the class member

See also
  GetUniqNum()

Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.

## GetItem() [2/2]

CBotVar * CBot::CBotVar::GetItem | ( | int | index,
|  | bool | grow = false )

virtual

Returns element of the array by index.

TODO: Appears to be also implemented in CBotVarClass, but I'm not sure what is it used for there. Looks like CBotVarArray stores data internally in CBotVarClass or something like that. Needs futher investigation.

Parameters

  index | Index of the element to get
  grow | true to grow the array automatically if the index is out of range

Returns
  CBotVar representing the array element, or nullptr on error (for example going out of range)

Reimplemented in CBot::CBotVarArray, and CBot::CBotVarClass.

## GetItemList()

CBotVar * CBot::CBotVar::GetItemList | ( |  | ) |

virtual

Return all elements of this variable as a linked list. Works for both classes and arrays.

Returns
  CBotVar representing the first object in the linked list. Use CBotVar::GetNext() to access next ones.

Reimplemented in CBot::CBotVarArray, CBot::CBotVarClass, and CBot::CBotVarPointer.

## operator bool()

CBot::CBotVar::operator bool | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator signed char()

CBot::CBotVar::operator signed char | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator short()

CBot::CBotVar::operator short | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator uint32_t()

CBot::CBotVar::operator uint32_t | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator int()

CBot::CBotVar::operator int | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator long()

CBot::CBotVar::operator long | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator float()

CBot::CBotVar::operator float | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator double()

CBot::CBotVar::operator double | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator std::string()

CBot::CBotVar::operator std::string | ( |  | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [1/9]

void CBot::CBotVar::operator= | ( | const CBotVar & | var | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [2/9]

void CBot::CBotVar::operator= | ( | signed char | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [3/9]

void CBot::CBotVar::operator= | ( | short | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [4/9]

void CBot::CBotVar::operator= | ( | uint32_t | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [5/9]

void CBot::CBotVar::operator= | ( | int | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [6/9]

void CBot::CBotVar::operator= | ( | long | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [7/9]

void CBot::CBotVar::operator= | ( | float | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [8/9]

void CBot::CBotVar::operator= | ( | double | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## operator=() [9/9]

void CBot::CBotVar::operator= | ( | const std::string & | x | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## SetVal()

void CBot::CBotVar::SetVal | ( | CBotVar * | var | ) |

Set the value.

Parameters

  var | Another variable to copy value from

## Copy()

void CBot::CBotVar::Copy | ( | CBotVar * | pSrc,
|  | bool | bName = true )

virtual

Copy from another variable.

Parameters

  pSrc | Variable to copy from
  bName | true if you want to also copy the name

Reimplemented in CBot::CBotVarArray, CBot::CBotVarClass, CBot::CBotVarInt, CBot::CBotVarPointer, CBot::CBotVarValue< T, type >, CBot::CBotVarValue< bool, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, CBot::CBotVarValue< signed char, type >, CBot::CBotVarValue< std::string, CBotTypString >, and CBot::CBotVarValue< uint32_t, type >.

## SetValByte()

void CBot::CBotVar::SetValByte | ( | signed char | val | ) |

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## SetValShort()

void CBot::CBotVar::SetValShort | ( | short | val | ) |

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## SetValChar()

void CBot::CBotVar::SetValChar | ( | uint32_t | val | ) |

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## SetValInt()

void CBot::CBotVar::SetValInt | ( | int | val,
|  | const std::string & | name = "" )

virtual

Set value as an integer.

This one should be used for boolean values, too

Parameters

  val | New value
  name | Used when you assign a constant value - makes the value appear as "name" instead of number in the debugger

Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, and CBot::CBotVarString.

## SetValLong()

void CBot::CBotVar::SetValLong | ( | long | val | ) |

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## SetValFloat()

void CBot::CBotVar::SetValFloat | ( | float | val | ) |

virtual

Set value as float.

Parameters

  val | New value

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, and CBot::CBotVarString.

## SetValDouble()

void CBot::CBotVar::SetValDouble | ( | double | val | ) |

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## SetValString()

void CBot::CBotVar::SetValString | ( | const std::string & | val | ) |

virtual

Set value as string.

Parameters

  val | New value

Reimplemented in CBot::CBotVarString, CBot::CBotVarValue< T, type >, CBot::CBotVarValue< bool, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, CBot::CBotVarValue< signed char, type >, CBot::CBotVarValue< std::string, CBotTypString >, and CBot::CBotVarValue< uint32_t, type >.

## GetValByte()

signed char CBot::CBotVar::GetValByte | ( |  | ) | const

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## GetValShort()

short CBot::CBotVar::GetValShort | ( |  | ) | const

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## GetValChar()

uint32_t CBot::CBotVar::GetValChar | ( |  | ) | const

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## GetValInt()

int CBot::CBotVar::GetValInt | ( |  | ) | const

virtual

Get value as integer.

Returns
  Current value

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, and CBot::CBotVarString.

## GetValLong()

long CBot::CBotVar::GetValLong | ( |  | ) | const

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## GetValFloat()

float CBot::CBotVar::GetValFloat | ( |  | ) | const

virtual

Get value as float.

Returns
  Current value

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, and CBot::CBotVarString.

## GetValDouble()

double CBot::CBotVar::GetValDouble | ( |  | ) | const

virtual

Set the value.

Parameters

  var | Another variable to copy value from

Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, and CBot::CBotVarNumberBase< uint32_t, type >.

## GetValString()

std::string CBot::CBotVar::GetValString | ( |  | ) | const

virtual

Get value as string.

This one is supported by most types of variables.

Automatically converts the value to string if needed.

Returns
  Current value

Reimplemented in CBot::CBotVarArray, CBot::CBotVarChar, CBot::CBotVarClass, CBot::CBotVarInt, CBot::CBotVarPointer, CBot::CBotVarValue< T, type >, CBot::CBotVarValue< bool, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, CBot::CBotVarValue< signed char, type >, CBot::CBotVarValue< std::string, CBotTypString >, and CBot::CBotVarValue< uint32_t, type >.

## SetPointer()

void CBot::CBotVar::SetPointer | ( | CBotVar * | p | ) |

virtual

Set value for pointer types.

Parameters

  p | Variable to point to

Reimplemented in CBot::CBotVarArray, and CBot::CBotVarPointer.

## GetPointer()

CBotVarClass * CBot::CBotVar::GetPointer | ( |  | ) |

virtual

Get value for pointer types.

Returns
  Variable that this variable points to

Reimplemented in CBot::CBotVarArray, CBot::CBotVarClass, and CBot::CBotVarPointer.

## Add()

void CBot::CBotVar::Add | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Addition.

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, and CBot::CBotVarString.

## Sub()

void CBot::CBotVar::Sub | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Subtraction.

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Mul()

void CBot::CBotVar::Mul | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Multiplication.

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Div()

CBotError CBot::CBotVar::Div | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Division.

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Modulo()

CBotError CBot::CBotVar::Modulo | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Modulo (remainder of division).

Reimplemented in CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Power()

void CBot::CBotVar::Power | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

Power.

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Lo()

bool CBot::CBotVar::Lo | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left < right

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Hi()

bool CBot::CBotVar::Hi | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left > right

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Ls()

bool CBot::CBotVar::Ls | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left <= right

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Hs()

bool CBot::CBotVar::Hs | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left >= right

Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Eq()

bool CBot::CBotVar::Eq | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left == right

Reimplemented in CBot::CBotVarClass, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarPointer, and CBot::CBotVarString.

## Ne()

bool CBot::CBotVar::Ne | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left != right

Reimplemented in CBot::CBotVarClass, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, CBot::CBotVarNumberBase< short, type >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarPointer, and CBot::CBotVarString.

## And()

void CBot::CBotVar::And | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left && right or left & right

Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## Or()

void CBot::CBotVar::Or | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left || right or left | right

Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## XOr()

void CBot::CBotVar::XOr | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left ^ right (also for boolean!)

Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## Not()

void CBot::CBotVar::Not | ( |  | ) |

virtual

!this or ~this

Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInt, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## ASR()

void CBot::CBotVar::ASR | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left >> right

Reimplemented in CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## SR()

void CBot::CBotVar::SR | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left >>> right

This is unsigned shift to right

Reimplemented in CBot::CBotVarByte, CBot::CBotVarChar, CBot::CBotVarInt, CBot::CBotVarLong, and CBot::CBotVarShort.

## SL()

void CBot::CBotVar::SL | ( | CBotVar * | left,
|  | CBotVar * | right )

virtual

left << right

Reimplemented in CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, CBot::CBotVarInteger< short, CBotTypShort >, CBot::CBotVarInteger< signed char, CBotTypByte >, and CBot::CBotVarInteger< uint32_t, CBotTypChar >.

## Neg()

void CBot::CBotVar::Neg | ( |  | ) |

virtual

-this

Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Inc()

void CBot::CBotVar::Inc | ( |  | ) |

virtual

++this

Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Dec()

void CBot::CBotVar::Dec | ( |  | ) |

virtual

–this

Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarNumber< signed char, type >, and CBot::CBotVarNumber< uint32_t, type >.

## Save0State()

bool CBot::CBotVar::Save0State | ( | std::ostream & | ostr | ) |

virtual

Save common variable header (name, type, etc.).

Parameters

  ostr | Output stream

Returns
  false on write error

Reimplemented in CBot::CBotVarInt.

## Save1State()

bool CBot::CBotVar::Save1State | ( | std::ostream & | ostr | ) |

virtual

Save variable data.

Overriden in child classes

Parameters

  ostr | Output stream

Returns
  false on write error

Reimplemented in CBot::CBotVarArray, CBot::CBotVarBoolean, CBot::CBotVarByte, CBot::CBotVarChar, CBot::CBotVarClass, CBot::CBotVarDouble, CBot::CBotVarFloat, CBot::CBotVarInt, CBot::CBotVarLong, CBot::CBotVarPointer, CBot::CBotVarShort, and CBot::CBotVarString.

## RestoreState()

bool CBot::CBotVar::RestoreState | ( | std::istream & | istr,
|  | CBotVar *& | pVar )

static

Restore variable.

Parameters

  | istr | Input stream
  [out] | pVar | Pointer to recieve the variable

Returns
  false on read error

## Friends And Related Symbol Documentation

## CBotStack

friend class CBotStack

friend

The corresponding token, defines the variable name.

## CBotCStack

friend class CBotCStack

friend

The corresponding token, defines the variable name.

## CBotInstrCall

friend class CBotInstrCall

friend

The corresponding token, defines the variable name.

## CBotProgram

friend class CBotProgram

friend

The corresponding token, defines the variable name.

## CBotClass

friend class CBotClass

friend

The corresponding token, defines the variable name.

## CBotVarClass

friend class CBotVarClass

friend

The corresponding token, defines the variable name.

## CBotVarPointer

friend class CBotVarPointer

friend

The corresponding token, defines the variable name.

## CBotVarArray

friend class CBotVarArray

friend

The corresponding token, defines the variable name.

## Member Data Documentation

## m_token

CBotToken* const CBot::CBotVar::m_token

protected

The corresponding token, defines the variable name.

## m_type

CBotTypResult CBot::CBotVar::m_type

protected

Type of value.

## m_binit

InitType CBot::CBotVar::m_binit

protected

Initialization status.

## m_pMyThis

CBotVarClass* CBot::CBotVar::m_pMyThis

protected

Corresponding this element (TODO: ?).

## m_pUserPtr

void* CBot::CBotVar::m_pUserPtr

protected

User pointer if specified.

See also
  SetUserPtr()
  GetUserPtr()

## m_bStatic

bool CBot::CBotVar::m_bStatic

protected

true if the variable is static (for classes)

## m_mPrivate

ProtectionLevel CBot::CBotVar::m_mPrivate

protected

Element protection level - public, protected or private (for classes).

## m_InitExpr

CBotInstr* CBot::CBotVar::m_InitExpr

protected

Expression describing initial value.

## m_LimExpr

CBotInstr* CBot::CBotVar::m_LimExpr

protected

Expression describing array limit.

## m_ident

long CBot::CBotVar::m_ident

protected

Identifier.

See also
  SetUniqNum()
  GetUniqNum()

## m_identcpt

long CBot::CBotVar::m_identcpt = 0

static protected

TODO: ?

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

- src/CBot/CBotVar/CBotVar.h
- src/CBot/CBotStack.cpp
- src/CBot/CBotVar/CBotVar.cpp