Colobot
|
#include <src/CBot/CBotVar/CBotVar.h>
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. More... | |
void | SetName (const std::string &name) |
SetName Changes the name of the variable. More... | |
CBotToken * | GetToken () |
Returns the CBotToken this variable is associated with. More... | |
CBotType | GetType (GetTypeMode mode=GetTypeMode::NORMAL) |
GetType Returns the base type of the variable (CBotType) More... | |
CBotTypResult | GetTypResult (GetTypeMode mode=GetTypeMode::NORMAL) |
Returns the complete type of the variable (CBotTypResult) More... | |
void | SetType (CBotTypResult &type) |
Change type of this variable. More... | |
virtual void | SetClass (CBotClass *pClass) |
Set class this variable is instance of. More... | |
virtual CBotClass * | GetClass () |
Return class this variable is instance of. More... | |
Initialization status | |
enum class | InitType : int { UNDEF = 0 , DEF = 1 , IS_POINTER = 2 , IS_NAN = 999 } |
Variable initialization status. More... | |
void | SetInit (InitType initType) |
Changes variable init status. More... | |
InitType | GetInit () const |
Returns the current init state of the variable. More... | |
bool | IsUndefined () const |
Checks if the variable is currently "undefined". More... | |
bool | IsDefined () const |
Checks if the variable is currently "defined". More... | |
bool | IsNAN () const |
Checks if the variable is currently NAN. More... | |
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". More... | |
bool | IsStatic () |
Checks if the variable is static. More... | |
void | SetPrivate (ProtectionLevel mPrivate) |
Sets variable protection level. More... | |
bool | IsPrivate (ProtectionLevel level=ProtectionLevel::Protected) |
Checks if the variable is accessible at the given protection level. More... | |
ProtectionLevel | GetPrivate () |
Get variable protection level. More... | |
bool | IsElemOfClass (const std::string &name) |
Check if a variable belongs to a class with a given name. More... | |
virtual void | ConstructorSet () |
Called after constructor has been called. More... | |
CBotVar * | GetStaticVar () |
If this is a static class variable, return the static var from the class. More... | |
virtual void | Update (void *pUser) |
Call the class update function. More... | |
void | SetUniqNum (long n) |
Set unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem. More... | |
long | GetUniqNum () |
Return unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem. More... | |
static long | NextUniqNum () |
Generate next unique identifier. More... | |
Save / restore state | |
CBotToken *const | m_token |
The corresponding token, defines the variable name. More... | |
CBotTypResult | m_type |
Type of value. More... | |
InitType | m_binit |
Initialization status. More... | |
CBotVarClass * | m_pMyThis |
Corresponding this element (TODO: ?) More... | |
void * | m_pUserPtr |
User pointer if specified. More... | |
bool | m_bStatic |
true if the variable is static (for classes) More... | |
ProtectionLevel | m_mPrivate |
Element protection level - public, protected or private (for classes) More... | |
CBotInstr * | m_InitExpr |
Expression describing initial value. More... | |
CBotInstr * | m_LimExpr |
Expression describing array limit. More... | |
long | m_ident |
Identifier. More... | |
static long | m_identcpt = 0 |
TODO: ? More... | |
class | CBotStack |
The corresponding token, defines the variable name. More... | |
class | CBotCStack |
The corresponding token, defines the variable name. More... | |
class | CBotInstrCall |
The corresponding token, defines the variable name. More... | |
class | CBotProgram |
The corresponding token, defines the variable name. More... | |
class | CBotClass |
The corresponding token, defines the variable name. More... | |
class | CBotVarClass |
The corresponding token, defines the variable name. More... | |
class | CBotVarPointer |
The corresponding token, defines the variable name. More... | |
class | CBotVarArray |
The corresponding token, defines the variable name. More... | |
virtual bool | Save0State (std::ostream &ostr) |
Save common variable header (name, type, etc.) More... | |
virtual bool | Save1State (std::ostream &ostr) |
Save variable data. More... | |
static bool | RestoreState (std::istream &istr, CBotVar *&pVar) |
Restore variable. More... | |
Creation / destruction | |
CBotVar () | |
Constructor. Do not call directly, use CBotVar::Create() More... | |
CBotVar (const CBotToken &name) | |
Constructor. Do not call directly, use CBotVar::Create() More... | |
virtual | ~CBotVar () |
Destructor. Do not call directly, use CBotVar::Destroy() More... | |
virtual void | SetIdent (long UniqId) |
Associates an unique identifier to class instance. More... | |
static CBotVar * | Create (const std::string &name, CBotTypResult type) |
Creates a new variable from a type described by CBotTypResult. More... | |
static CBotVar * | Create (const std::string &name, CBotClass *pClass) |
Creates a new variable of a given class type. More... | |
static CBotVar * | Create (const CBotToken &name, CBotType type) |
Creates a new variable of a given type. More... | |
static CBotVar * | Create (const CBotToken &name, CBotTypResult type) |
Create a new variable of a given type described by CBotTypResult. More... | |
static CBotVar * | Create (const std::string &name, CBotType type, CBotClass *pClass) |
Create a new variable of a given type of given class instance. More... | |
static CBotVar * | Create (CBotVar *pVar) |
Create a new variable of the same type and name as another one. More... | |
static void | Destroy (CBotVar *var) |
Destroy a variable. More... | |
User pointer | |
void | SetUserPtr (void *pUser) |
Set a custom pointer associated with this variable. More... | |
void * | GetUserPtr () |
Returns the custom pointer associated with this variable. More... | |
Class / array member access | |
virtual CBotVar * | GetItem (const std::string &name) |
Returns class member by name. More... | |
virtual CBotVar * | GetItemRef (int nIdent) |
Returns class member by unique ID. More... | |
virtual CBotVar * | GetItem (int index, bool grow=false) |
Returns element of the array by index. More... | |
virtual CBotVar * | GetItemList () |
Return all elements of this variable as a linked list. Works for both classes and arrays. More... | |
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. More... | |
operator signed char () | |
Set the value. More... | |
operator short () | |
Set the value. More... | |
operator uint32_t () | |
Set the value. More... | |
operator int () | |
Set the value. More... | |
operator long () | |
Set the value. More... | |
operator float () | |
Set the value. More... | |
operator double () | |
Set the value. More... | |
operator std::string () | |
Set the value. More... | |
void | operator= (const CBotVar &var) |
Set the value. More... | |
void | operator= (signed char x) |
Set the value. More... | |
void | operator= (short x) |
Set the value. More... | |
void | operator= (uint32_t x) |
Set the value. More... | |
void | operator= (int x) |
Set the value. More... | |
void | operator= (long x) |
Set the value. More... | |
void | operator= (float x) |
Set the value. More... | |
void | operator= (double x) |
Set the value. More... | |
void | operator= (const std::string &x) |
Set the value. More... | |
void | SetVal (CBotVar *var) |
Set the value. More... | |
virtual void | Copy (CBotVar *pSrc, bool bName=true) |
Copy from another variable. More... | |
virtual void | SetValByte (signed char val) |
Set the value. More... | |
virtual void | SetValShort (short val) |
Set the value. More... | |
virtual void | SetValChar (uint32_t val) |
Set the value. More... | |
virtual void | SetValInt (int val, const std::string &name="") |
Set value as an integer. More... | |
virtual void | SetValLong (long val) |
Set the value. More... | |
virtual void | SetValFloat (float val) |
Set value as float. More... | |
virtual void | SetValDouble (double val) |
Set the value. More... | |
virtual void | SetValString (const std::string &val) |
Set value as string. More... | |
virtual signed char | GetValByte () |
Set the value. More... | |
virtual short | GetValShort () |
Set the value. More... | |
virtual uint32_t | GetValChar () |
Set the value. More... | |
virtual int | GetValInt () |
Get value as integer. More... | |
virtual long | GetValLong () |
Set the value. More... | |
virtual float | GetValFloat () |
Get value as float. More... | |
virtual double | GetValDouble () |
Set the value. More... | |
virtual std::string | GetValString () |
Get value as string. More... | |
virtual void | SetPointer (CBotVar *p) |
Set value for pointer types. More... | |
virtual CBotVarClass * | GetPointer () |
Get value for pointer types. More... | |
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. More... | |
virtual void | Sub (CBotVar *left, CBotVar *right) |
Subtraction. More... | |
virtual void | Mul (CBotVar *left, CBotVar *right) |
Multiplication. More... | |
virtual CBotError | Div (CBotVar *left, CBotVar *right) |
Division. More... | |
virtual CBotError | Modulo (CBotVar *left, CBotVar *right) |
Modulo (remainder of division) More... | |
virtual void | Power (CBotVar *left, CBotVar *right) |
Power. More... | |
Comparation functions | |
virtual bool | Lo (CBotVar *left, CBotVar *right) |
left < right More... | |
virtual bool | Hi (CBotVar *left, CBotVar *right) |
left > right More... | |
virtual bool | Ls (CBotVar *left, CBotVar *right) |
left <= right More... | |
virtual bool | Hs (CBotVar *left, CBotVar *right) |
left >= right More... | |
virtual bool | Eq (CBotVar *left, CBotVar *right) |
left == right More... | |
virtual bool | Ne (CBotVar *left, CBotVar *right) |
left != right More... | |
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 More... | |
virtual void | Or (CBotVar *left, CBotVar *right) |
left || right or left | right More... | |
virtual void | XOr (CBotVar *left, CBotVar *right) |
left ^ right (also for boolean!) More... | |
virtual void | Not () |
!this or ~this More... | |
Bitwise shift | |
virtual void | ASR (CBotVar *left, CBotVar *right) |
left >> right More... | |
virtual void | SR (CBotVar *left, CBotVar *right) |
left >>> right More... | |
virtual void | SL (CBotVar *left, CBotVar *right) |
left << right More... | |
Negation / increment / decrement | |
virtual void | Neg () |
-this More... | |
virtual void | Inc () |
++this More... | |
virtual void | Dec () |
–this More... | |
Additional Inherited Members | |
![]() | |
virtual | ~CBotLinkedList () |
Destructor. Be careful, destroys the whole linked list! More... | |
CBotVar * | GetNext () |
Returns the next variable in the linked list. More... | |
void | AddNext (CBotVar *elem) |
Appends a new element at the end of the linked list. More... | |
![]() | |
CBotVar * | m_next |
A CBot variable.
|
strong |
Mode for GetType() and GetTypResult()
|
strong |
Variable initialization status.
Enumerator | |
---|---|
UNDEF | the variable value is currently not defined |
DEF | the variable value is defined |
IS_POINTER | the variable value is as a pointer |
IS_NAN | the variable value is NAN |
|
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 |
CBot::CBotVar::CBotVar | ( | ) |
Constructor. Do not call directly, use CBotVar::Create()
CBot::CBotVar::CBotVar | ( | const CBotToken & | name | ) |
Constructor. Do not call directly, use CBotVar::Create()
|
virtual |
Destructor. Do not call directly, use CBotVar::Destroy()
|
static |
Creates a new variable from a type described by CBotTypResult.
name | Variable name |
type | Variable type |
Creates a new variable of a given class type.
This is equivalent to:
name | Variable name |
pClass | Class type |
Creates a new variable of a given type.
This is equivalent to:
name | Variable name token |
type | Variable type |
|
static |
Create a new variable of a given type described by CBotTypResult.
name | Variable name token |
type | Variable type |
|
static |
Create a new variable of a given type of given class instance.
This is equivalent to:
name | Variable name |
type | Variable type |
pClass | Class |
Create a new variable of the same type and name as another one.
Contents of the variable are NOT copied.
pVar | other variable to take type and name from |
|
static |
Destroy a variable.
var | variable to be destroyed |
|
virtual |
Associates an unique identifier to class instance.
Used only by classes
UniqId | New unique identifier |
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
void CBot::CBotVar::SetUserPtr | ( | void * | pUser | ) |
Set a custom pointer associated with this variable.
pUser | custom pointer to set |
void * CBot::CBotVar::GetUserPtr | ( | ) |
Returns the custom pointer associated with this variable.
const std::string & CBot::CBotVar::GetName | ( | ) |
Returns the name of the variable.
void CBot::CBotVar::SetName | ( | const std::string & | name | ) |
SetName Changes the name of the variable.
name | New name |
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
CBotType CBot::CBotVar::GetType | ( | GetTypeMode | mode = GetTypeMode::NORMAL | ) |
GetType Returns the base type of the variable (CBotType)
mode | Mode, see GetTypeMode enum |
CBotTypResult CBot::CBotVar::GetTypResult | ( | GetTypeMode | mode = GetTypeMode::NORMAL | ) |
Returns the complete type of the variable (CBotTypResult)
mode | Mode, see GetTypeMode enum |
void CBot::CBotVar::SetType | ( | CBotTypResult & | type | ) |
Change type of this variable.
type | new type |
|
virtual |
Set class this variable is instance of.
Used by instance variables, NOT class members
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
|
virtual |
Return class this variable is instance of.
Used by instance variables, NOT class members
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
void CBot::CBotVar::SetInit | ( | CBotVar::InitType | initType | ) |
Changes variable init status.
initType | New init status |
CBotVar::InitType CBot::CBotVar::GetInit | ( | ) | const |
Returns the current init state of the variable.
|
inline |
Checks if the variable is currently "undefined".
|
inline |
Checks if the variable is currently "defined".
|
inline |
Checks if the variable is currently NAN.
void CBot::CBotVar::SetStatic | ( | bool | bStatic | ) |
Marks the variable as "static".
Useful only for class members
bStatic | static or not |
bool CBot::CBotVar::IsStatic | ( | ) |
Checks if the variable is static.
Useful only for class members
void CBot::CBotVar::SetPrivate | ( | ProtectionLevel | mPrivate | ) |
Sets variable protection level.
Useful only for class members
mPrivate | New protection level |
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
level | Protection level to check access at |
CBotVar::ProtectionLevel CBot::CBotVar::GetPrivate | ( | ) |
Get variable protection level.
bool CBot::CBotVar::IsElemOfClass | ( | const std::string & | name | ) |
Check if a variable belongs to a class with a given name.
Works correctly with inheritance.
name | Class name to check |
|
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.
CBotVar * CBot::CBotVar::GetStaticVar | ( | ) |
If this is a static class variable, return the static var from the class.
|
virtual |
Call the class update function.
pUser | User pointer to pass to the update function |
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
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.
n | New identifier |
long CBot::CBotVar::GetUniqNum | ( | ) |
Return unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem.
|
static |
Generate next unique identifier.
Used by both variables (CBotVar) and functions (CBotFunction)
|
virtual |
Returns class member by name.
name | Name of member to get |
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
|
virtual |
Returns class member by unique ID.
nIdent | Unique ID of the class member to return |
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarPointer.
|
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.
index | Index of the element to get |
grow | true to grow the array automatically if the index is out of range |
Reimplemented in CBot::CBotVarClass, and CBot::CBotVarArray.
|
virtual |
Return all elements of this variable as a linked list. Works for both classes and arrays.
Reimplemented in CBot::CBotVarArray, CBot::CBotVarClass, and CBot::CBotVarPointer.
CBot::CBotVar::operator bool | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator signed char | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator short | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator uint32_t | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator int | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator long | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator float | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator double | ( | ) |
Set the value.
var | Another variable to copy value from |
CBot::CBotVar::operator std::string | ( | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | const CBotVar & | var | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | signed char | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | short | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | uint32_t | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | int | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | long | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | float | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | double | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::operator= | ( | const std::string & | x | ) |
Set the value.
var | Another variable to copy value from |
void CBot::CBotVar::SetVal | ( | CBotVar * | var | ) |
Set the value.
var | Another variable to copy value from |
|
virtual |
Copy from another variable.
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< signed char, type >, CBot::CBotVarValue< uint32_t, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, and CBot::CBotVarValue< std::string, CBotTypString >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set value as an integer.
This one should be used for boolean values, too
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::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set value as float.
val | New value |
Reimplemented in CBot::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set value as string.
val | New value |
Reimplemented in CBot::CBotVarString, CBot::CBotVarValue< T, type >, CBot::CBotVarValue< bool, type >, CBot::CBotVarValue< signed char, type >, CBot::CBotVarValue< uint32_t, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, and CBot::CBotVarValue< std::string, CBotTypString >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Get value as integer.
Reimplemented in CBot::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Get value as float.
Reimplemented in CBot::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Set the value.
var | Another variable to copy value from |
Reimplemented in CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
|
virtual |
Get value as string.
This one is supported by most types of variables.
Automatically converts the value to string if needed.
Reimplemented in CBot::CBotVarArray, CBot::CBotVarChar, CBot::CBotVarClass, CBot::CBotVarInt, CBot::CBotVarPointer, CBot::CBotVarValue< T, type >, CBot::CBotVarValue< bool, type >, CBot::CBotVarValue< signed char, type >, CBot::CBotVarValue< uint32_t, type >, CBot::CBotVarValue< double, type >, CBot::CBotVarValue< float, type >, CBot::CBotVarValue< int, type >, CBot::CBotVarValue< long, type >, CBot::CBotVarValue< short, type >, and CBot::CBotVarValue< std::string, CBotTypString >.
|
virtual |
Set value for pointer types.
p | Variable to point to |
Reimplemented in CBot::CBotVarArray, and CBot::CBotVarPointer.
|
virtual |
Get value for pointer types.
Reimplemented in CBot::CBotVarArray, CBot::CBotVarClass, and CBot::CBotVarPointer.
Addition.
Reimplemented in CBot::CBotVarString, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
Subtraction.
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
Multiplication.
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
Division.
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
Modulo (remainder of division)
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, CBot::CBotVarNumber< short, type >, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, and CBot::CBotVarInteger< short, CBotTypShort >.
Power.
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
left < right
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
left > right
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
left <= right
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
left >= right
Reimplemented in CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
left == right
Reimplemented in CBot::CBotVarClass, CBot::CBotVarPointer, CBot::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
left != right
Reimplemented in CBot::CBotVarClass, CBot::CBotVarPointer, CBot::CBotVarString, CBot::CBotVarNumberBase< T, type >, CBot::CBotVarNumberBase< bool, CBotTypBoolean >, CBot::CBotVarNumberBase< signed char, type >, CBot::CBotVarNumberBase< uint32_t, type >, CBot::CBotVarNumberBase< double, type >, CBot::CBotVarNumberBase< float, type >, CBot::CBotVarNumberBase< int, type >, CBot::CBotVarNumberBase< long, type >, and CBot::CBotVarNumberBase< short, type >.
left && right or left & right
Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, and CBot::CBotVarInteger< short, CBotTypShort >.
left || right or left | right
Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, and CBot::CBotVarInteger< short, CBotTypShort >.
left ^ right (also for boolean!)
Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, and CBot::CBotVarInteger< short, CBotTypShort >.
|
virtual |
!this or ~this
Reimplemented in CBot::CBotVarBoolean, CBot::CBotVarInt, CBot::CBotVarInteger< T, type >, CBot::CBotVarInteger< signed char, CBotTypByte >, CBot::CBotVarInteger< uint32_t, CBotTypChar >, CBot::CBotVarInteger< int, CBotTypInt >, CBot::CBotVarInteger< long, CBotTypLong >, and CBot::CBotVarInteger< short, CBotTypShort >.
left >>> right
This is unsigned shift to right
Reimplemented in CBot::CBotVarByte, CBot::CBotVarChar, CBot::CBotVarInt, CBot::CBotVarLong, and CBot::CBotVarShort.
|
virtual |
-this
Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
|
virtual |
++this
Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
|
virtual |
–this
Reimplemented in CBot::CBotVarInt, CBot::CBotVarNumber< T, type >, CBot::CBotVarNumber< signed char, type >, CBot::CBotVarNumber< uint32_t, type >, CBot::CBotVarNumber< double, CBotTypDouble >, CBot::CBotVarNumber< float, CBotTypFloat >, CBot::CBotVarNumber< int, type >, CBot::CBotVarNumber< long, type >, and CBot::CBotVarNumber< short, type >.
|
virtual |
Save common variable header (name, type, etc.)
ostr | Output stream |
Reimplemented in CBot::CBotVarInt.
|
virtual |
Save variable data.
Overriden in child classes
ostr | Output stream |
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.
|
static |
Restore variable.
istr | Input stream | |
[out] | pVar | Pointer to recieve the variable |
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
friend |
The corresponding token, defines the variable name.
|
protected |
The corresponding token, defines the variable name.
|
protected |
Type of value.
|
protected |
Initialization status.
|
protected |
Corresponding this element (TODO: ?)
|
protected |
User pointer if specified.
|
protected |
true if the variable is static (for classes)
|
protected |
Element protection level - public, protected or private (for classes)
|
protected |
Expression describing initial value.
|
protected |
Expression describing array limit.
|
protected |
Identifier.
|
staticprotected |
TODO: ?