Loading...
Searching...
No Matches
CBot Namespace Reference

CBot engine. More...

## Classes

class | CBotClass
| A CBot class definition. More...
class | CBotCStack
| The CBotCStack class Management of the stack of compilation. More...
class | CBotDebug
| Various utilities used for debugging. More...
class | CBotDefParam
| The CBotDefParam class A list of parameters. More...
class | CBotExternalCall
| Interface for external CBot calls. More...
class | CBotExternalCallDefault
| Default implementation of CBot external call, using compilation and runtime functions. More...
class | CBotExternalCallClass
| Implementation of CBot external call for class methods, using compilation and runtime functions. More...
class | CBotExternalCallList
| Class for mangaging CBot external calls. More...
class | CBotBlock
| An instruction block - { ... }. More...
class | CBotBoolExpr
| An expression that results in a boolean value. More...
class | CBotBreak
| Instructions "break" and "continue" (with an optional label). More...
class | CBotCase
| Instruction "case", part of "switch" structure. More...
class | CBotCatch
| Instruction "catch", part of "try" structure. More...
class | CBotCondition
| A condition - boolean expression enclosed in brackets - (condition). More...
class | CBotDefArray
| Definition of an array (of any type). More...
class | CBotDefBoolean
| Definition of boolean variable - bool a, b = false. More...
class | CBotDefClass
| Definition of class instance variable. More...
class | CBotDefFloat
| Definition of a float variable - float a, b = 12.4. More...
class | CBotDefInt
| Definition of an integer variable - int a, b = 12. More...
class | CBotDefString
| Definition of a string variable - string a, b = "text";. More...
class | CBotDo
| do {...} while (...) structure More...
class | CBotEmpty
| Constant -1 of type int. More...
class | CBotExpression
| An arithmetic expression, with or without assignment. More...
class | CBotExprLitBool
| A boolean literal - true/false. More...
class | CBotExprLitChar
| A character literal. More...
class | CBotExprLitNan
| The "nan" constant. More...
class | CBotExprLitNull
| The "null" constant. More...
class | CBotExprLitNum
| A number literal - 5, 1, 2.5, 3.75, etc. or a predefined numerical constant (see CBotToken::DefineNum()). More...
class | CBotExprLitString
| A string literal - "Some text". More...
class | CBotExprRetVar
| Access a member/element of the variable on the stack. More...
class | CBotExprUnaire
| Unary expression - +a, -a, !a, ~a, not a. More...
class | CBotExprVar
| Expression representing a variable name. More...
class | CBotFieldExpr
| Accessing a class field using dot operator - toto.x. More...
class | CBotFor
| Instruction for (init; test; incr) { ... }. More...
class | CBotFunction
| A function declaration in the code. More...
class | CBotIf
| Instruction if (condition) { ... } else { ... }. More...
class | CBotIndexExpr
| Instruction accessing an array element - array[x]. More...
class | CBotInstr
| Class for one CBot instruction. More...
class | CBotInstrCall
| A call to a function - func(). More...
class | CBotInstrMethode
| A call to class method - var.func(). More...
class | CBotLeftExpr
| Compilation of left side of an assignment. More...
class | CBotLeftExprVar
| A variable on the left side of an assignment. More...
class | CBotListArray
| Compilation of assignment of an array - {{1, 2, 3}, {3, 2, 1}}. More...
class | CBotListExpression
| Compile a comma-separated list of expressions or variable definitions. More...
class | CBotListInstr
| A list of instructions separated by semicolons - ...; ...; ...; ...;. More...
class | CBotLogicExpr
| An "inline if" operator - condition ? if_true : if_false. More...
class | CBotNew
| Creation of a class instance - "new" operator - new SomeClass(). More...
class | CBotParExpr
| An expression. More...
class | CBotPostIncExpr
| Post increment/decrement. More...
class | CBotPreIncExpr
| Pre increment/decrement. More...
class | CBotRepeat
| The "repeat" loop - repeat (times) { ... }. More...
class | CBotReturn
| The "return" instruction. More...
class | CBotSwitch
| The switch structure. More...
class | CBotThrow
| The "throw" instruction. More...
class | CBotTry
| The "try" structure. More...
class | CBotTwoOpExpr
| Any expression with two operands. More...
class | CBotWhile
| The "while" loop - while (condition) { ... }. More...
class | CBotProgram
| Class that manages a CBot program. This is the main entry point into the CBot engine. More...
class | CBotStack
| The execution stack. More...
class | CBotToken
| Class representing one token of a program. More...
class | CBotTypResult
| Class to define the complete type of a variable. More...
class | CBotLinkedList
class | CBotDoublyLinkedList
class | CBotVar
| A CBot variable. More...
class | CBotVarArray
| CBotVar subclass for managing arrays (::CBotTypArrayPointer). More...
class | CBotVarBoolean
| CBotVar subclass for managing boolean values (::CBotTypBoolean). More...
class | CBotVarByte
| CBotVar subclass for managing 1-byte integer values (::CBotTypByte). More...
class | CBotVarChar
| CBotVar subclass for managing 32-bit Unicode values (::CBotTypChar). More...
class | CBotVarClass
| CBotVar subclass for managing classes (::CBotTypClass, ::CBotTypIntrinsic). More...
class | CBotVarDouble
| CBotVar subclass for managing double values (::CBotTypDouble). More...
class | CBotVarFloat
| CBotVar subclass for managing float values (::CBotTypFloat). More...
class | CBotVarInt
| CBotVar subclass for managing integer values (::CBotTypInt). More...
class | CBotVarLong
| CBotVar subclass for managing long integer values (::CBotTypLong). More...
class | CBotVarPointer
| CBotVar subclass for managing pointers to classes (::CBotTypPointer). More...
class | CBotVarShort
| CBotVar subclass for managing short integer values (::CBotTypShort). More...
class | CBotVarString
| CBotVar subclass for managing string values (::CBotTypString). More...
class | CBotVarValue
| A variable holding a simple value (bool, int, float, string). More...
class | CBotVarNumberBase
| A number based variable (bool, int, float). More...
class | CBotVarNumber
| A number variable (int, float). More...
class | CBotVarInteger
| An integer variable (byte, short, char, int, long). More...
class | CBotFile
class | CBotFileAccessHandler

## Enumerations

enum | CBotType { CBotTypVoid = 0 , CBotTypByte = 1 , CBotTypShort = 2 , CBotTypChar = 3 , CBotTypInt = 4 , CBotTypLong = 5 , CBotTypFloat = 6 , CBotTypDouble = 7 , CBotTypBoolean = 8 , CBotTypString = 9 , CBotTypArrayPointer = 10 , CBotTypArrayBody = 11 , CBotTypPointer = 12 , CBotTypNullPointer = 13 , CBotTypClass = 15 , CBotTypIntrinsic = 16 , CBotTypMAX = 20 }
| Defines known types. This types are modeled on Java types. More...
enum | CBotGet { GetPosExtern = 1 , GetPosNom = 2 , GetPosParam = 3 , GetPosBloc = 4 }
| Different modes for CBotProgram::GetPosition. More...

enum

TokenId {
TokenKeyWord = 2000 , ID_IF = 2000 , ID_ELSE , ID_WHILE ,
ID_DO , ID_FOR , ID_BREAK , ID_CONTINUE ,
ID_SWITCH , ID_CASE , ID_DEFAULT , ID_TRY ,
ID_THROW , ID_CATCH , ID_FINALLY , ID_TXT_AND ,
ID_TXT_OR , ID_TXT_NOT , ID_RETURN , ID_CLASS ,
ID_EXTENDS , ID_SYNCHO , ID_NEW , ID_PUBLIC ,
ID_EXTERN , ID_STATIC , ID_PROTECTED , ID_PRIVATE ,
ID_REPEAT , ID_INT , ID_FLOAT , ID_BOOLEAN ,
ID_STRING , ID_VOID , ID_BOOL , ID_BYTE ,
ID_SHORT , ID_CHAR , ID_LONG , ID_DOUBLE ,
TokenKeyVal = 2200 , ID_TRUE = 2200 , ID_FALSE , ID_NULL ,
ID_NAN , TokenKeyOp = 2300 , ID_OPENPAR = 2300 , ID_CLOSEPAR ,
ID_OPBLK , ID_CLBLK , ID_SEP , ID_COMMA ,
ID_DOTS , ID_DOT , ID_OPBRK , ID_CLBRK ,
ID_DBLDOTS , ID_LOGIC , ID_ADD , ID_SUB ,
ID_MUL , ID_DIV , ID_ASS , ID_ASSADD ,
ID_ASSSUB , ID_ASSMUL , ID_ASSDIV , ID_ASSOR ,
ID_ASSAND , ID_ASSXOR , ID_ASSSL , ID_ASSSR ,
ID_ASSASR , ID_SL , ID_SR , ID_ASR ,
ID_INC , ID_DEC , ID_LO , ID_HI ,
ID_LS , ID_HS , ID_EQ , ID_NE ,
ID_AND , ID_XOR , ID_OR , ID_LOG_AND ,
ID_LOG_OR , ID_LOG_NOT , ID_NOT , ID_MODULO ,
ID_POWER , ID_ASSMODULO , TX_UNDEF = 4000 , TX_NAN
}

| This enum contains possible token types. More...
enum | TokenType { TokenTypNone = 0 , TokenTypKeyWord = 1 , TokenTypNum = 2 , TokenTypString = 3 , TokenTypVar = 4 , TokenTypDef = 5 , TokenTypChar = 6 }
| Types of tokens. More...

enum

CBotError : int {
CBotNoErr = 0 , CBotErrOpenPar = 5000 , CBotErrClosePar = 5001 , CBotErrNotBoolean = 5002 ,
CBotErrUndefVar = 5003 , CBotErrBadLeft = 5004 , CBotErrNoTerminator = 5005 , CBotErrCaseOut = 5006 ,
CBotErrNoEnd = 5007 , CBotErrCloseBlock = 5008 , CBotErrElseWhitoutIf = 5009 , CBotErrOpenBlock = 5010 ,
CBotErrBadType1 = 5011 , CBotErrRedefVar = 5012 , CBotErrBadType2 = 5013 , CBotErrUndefCall = 5014 ,
CBotErrNoDoubleDots = 5015 , CBotErrNoWhile = 5016 , CBotErrBreakOutside = 5017 , CBotErrUndefLabel = 5019 ,
CBotErrLabel = 5018 , CBotErrNoCase = 5020 , CBotErrBadNum = 5021 , CBotErrVoid = 5022 ,
CBotErrNoType = 5023 , CBotErrNoVar = 5024 , CBotErrNoFunc = 5025 , CBotErrOverParam = 5026 ,
CBotErrRedefFunc = 5027 , CBotErrLowParam = 5028 , CBotErrBadParam = 5029 , CBotErrNbParam = 5030 ,
CBotErrUndefItem = 5031 , CBotErrUndefClass = 5032 , CBotErrNoConstruct = 5033 , CBotErrRedefClass = 5034 ,
CBotErrCloseIndex = 5035 , CBotErrReserved = 5036 , CBotErrBadNew = 5037 , CBotErrOpenIndex = 5038 ,
CBotErrBadString = 5039 , CBotErrBadIndex = 5040 , CBotErrPrivate = 5041 , CBotErrNoPublic = 5042 ,
CBotErrNoExpression = 5043 , CBotErrAmbiguousCall = 5044 , CBotErrFuncNotVoid = 5045 , CBotErrNoClassName = 5046 ,
CBotErrNoReturn = 5047 , CBotErrDefaultValue = 5048 , CBotErrEndQuote = 5049 , CBotErrBadEscape = 5050 ,
CBotErrOctalRange = 5051 , CBotErrHexDigits = 5052 , CBotErrHexRange = 5053 , CBotErrUnicodeName = 5054 ,
CBotErrCharEmpty = 5055 , CBotErrRedefCase = 5056 , CBotErrZeroDiv = 6000 , CBotErrNotInit = 6001 ,
CBotErrBadThrow = 6002 , CBotErrNoRetVal = 6003 , CBotErrNoRun = 6004 , CBotErrUndefFunc = 6005 ,
CBotErrNotClass = 6006 , CBotErrNull = 6007 , CBotErrNan = 6008 , CBotErrOutArray = 6009 ,
CBotErrStackOver = 6010 , CBotErrDeletedPtr = 6011 , CBotErrFileOpen = 6012 , CBotErrNotOpen = 6013 ,
CBotErrRead = 6014 , CBotErrWrite = 6015 , CBotErrMAX
}

| This enum contains possible CBot error values. Values in range 5000-5999 are compile errors, 6000-6999 are runtime errors. More...

## Functions

bool | WriteWord (std::ostream &ostr, unsigned short w)
| WriteWord.
bool | ReadWord (std::istream &istr, unsigned short &w)
| ReadWord.
bool | WriteByte (std::ostream &ostr, char c)
| WriteByte.
bool | ReadByte (std::istream &istr, char &c)
| ReadByte.
bool | WriteShort (std::ostream &ostr, short s)
| WriteShort.
bool | ReadShort (std::istream &istr, short &s)
| ReadShort.
bool | WriteUInt32 (std::ostream &ostr, uint32_t i)
| WriteUInt32.
bool | ReadUInt32 (std::istream &istr, uint32_t &i)
| ReadUInt32.
bool | WriteInt (std::ostream &ostr, int i)
| WriteInt.
bool | ReadInt (std::istream &istr, int &i)
| ReadInt.
bool | WriteLong (std::ostream &ostr, long l, unsigned padTo=0)
| WriteLong.
bool | ReadLong (std::istream &istr, long &l)
| ReadLong.
bool | WriteFloat (std::ostream &ostr, float f)
| WriteFloat.
bool | ReadFloat (std::istream &istr, float &f)
| ReadFloat.
bool | WriteDouble (std::ostream &ostr, double d)
| WriteDouble.
bool | ReadDouble (std::istream &istr, double &d)
| ReadDouble.
bool | WriteString (std::ostream &ostr, const std::string &s)
| WriteString.
bool | ReadString (std::istream &istr, std::string &s)
| ReadString.
bool | WriteType (std::ostream &ostr, const CBotTypResult &type)
| WriteType.
bool | ReadType (std::istream &istr, CBotTypResult &type)
| ReadType.
bool | WriteStream (std::ostream &ostr, std::istream &istr)
| WriteStream.
bool | ReadStream (std::istream &istr, std::ostream &ostr)
| ReadStream.
bool | SaveVars (std::ostream &ostr, CBotVar *pVar)
| Save a linked list if variables.
CBotInstr * | CompileExprLitNum (CBotToken *&p, CBotCStack *pStack)
CBotInstr * | CompileSizeOf (CBotToken *&p, CBotCStack *pStack)
CBotInstr * | CompileParams (CBotToken *&p, CBotCStack *pStack, CBotVar **ppVars)
| CompileParams Compile a list of parameters.
bool | TypeCompatible (CBotTypResult &type1, CBotTypResult &type2, int op=0)
| TypeCompatible Check if two results are consistent to make an operation. TypeCompatible is used in two ways: For non-assignment operations: see CBotTwoOpExpr::Compile TypeCompatible( leftType, rightType, opType ).
bool | TypesCompatibles (const CBotTypResult &type1, const CBotTypResult &type2)
| TypesCompatibles Check if two variables are compatible for parameter passing.
const std::string & | LoadString (TokenId id)
| Maps given ID to its string equivalent.
bool | IsOfType (CBotToken *&p, int type1, int type2=-1)
| Check if this token is of specified type.
bool | IsOfTypeList (CBotToken *&p, int type1,...)
| Check if this token is of specified type.
CBotVar * | MakeListVars (CBotVar **ppVars, bool bSetVal=false)
| MakeListVars Transforms the array of pointers to variables in a chained list of variables.
CBotTypResult | TypeParam (CBotToken *&p, CBotCStack *pile)
| TypeParam.
CBotTypResult | ArrayType (CBotToken *&p, CBotCStack *pile, CBotTypResult type)
| ArrayType.
long | GetNumInt (const std::string &str)
| GetNumInt Converts a string into integer may be of the form 0xabc123.
double | GetNumFloat (const std::string &str)
| GetNumFloat Converts a string into a float number.
bool | CharInList (const char c, const char *list)
| Search a null-terminated string for a char value.
std::string | CodePointToUTF8 (unsigned int val)
| Converts a Unicode code point to UTF-8 encoded character.
CBotTypResult | cNull (CBotVar *&var, void *user)
CBotTypResult | cOneFloat (CBotVar *&var, void *user)
CBotTypResult | cTwoFloat (CBotVar *&var, void *user)
CBotTypResult | cString (CBotVar *&var, void *user)
CBotTypResult | cStringString (CBotVar *&var, void *user)
CBotTypResult | cOneInt (CBotVar *&var, void *user)
CBotTypResult | cOneIntReturnBool (CBotVar *&var, void *user)
CBotTypResult | cStrStr (CBotVar *&var, void *user)
CBotTypResult | cIntStrStr (CBotVar *&var, void *user)
CBotTypResult | cFloatStr (CBotVar *&var, void *user)
CBotTypResult | cStrStrIntInt (CBotVar *&var, void *user)
CBotTypResult | cStrStrInt (CBotVar *&var, void *user)
CBotTypResult | cIntStr (CBotVar *&var, void *user)
void | InitFileFunctions ()
void | SetFileAccessHandler (std::unique_ptr< CBotFileAccessHandler > fileHandler)
void | InitMathFunctions ()
void | InitStringFunctions ()

## Variables

const int | DEFAULT_TIMER = 100

## Detailed Description

CBot engine.

## Enumeration Type Documentation

## CBotType

enum CBot::CBotType

Defines known types. This types are modeled on Java types.

Do not change the order of elements.

Enumerator
CBotTypVoid | void
CBotTypByte | byte
CBotTypShort | short
CBotTypChar | char
CBotTypInt | int
CBotTypLong | long
CBotTypFloat | float
CBotTypDouble | double
CBotTypBoolean | bool
CBotTypString | string
CBotTypArrayPointer | Pointer to an array (::CBotTypArrayBody).
CBotTypArrayBody | Array.
CBotTypPointer | Pointer to a class (::CBotTypClass or ::CBotTypIntrinsic).
CBotTypNullPointer | Null pointer.
CBotTypClass | Class instance.
CBotTypIntrinsic | Intrinsic class instance.

## CBotGet

enum CBot::CBotGet

Different modes for CBotProgram::GetPosition.

## TokenId

enum CBot::TokenId

This enum contains possible token types.

Enumerator
TokenKeyWord | keywords
TokenKeyVal | keywords that represent values (true, false, null, nan)
TokenKeyOp | operators

## TokenType

enum CBot::TokenType

Types of tokens.

Enumerator
TokenTypKeyWord | keyword of the language (see TokenKeyWord)
TokenTypNum | number
TokenTypString | string
TokenTypVar | a variable name
TokenTypDef | value according DefineNum
TokenTypChar | character literal

## CBotError

enum CBot::CBotError : int

This enum contains possible CBot error values. Values in range 5000-5999 are compile errors, 6000-6999 are runtime errors.

Note that other values ​​may be returned, for example exceptions for user-defined builtin functions, or "throw" instruction

Also note that these can't overlap with CBotType, see CBotTypResult for explanation

Enumerator
CBotErrOpenPar | missing the opening parenthesis
CBotErrClosePar | missing the closing parenthesis
CBotErrNotBoolean | expression must be a boolean
CBotErrUndefVar | undeclared variable
CBotErrBadLeft | assignment impossible ( 5 = ... )
CBotErrNoTerminator | semicolon expected
CBotErrCaseOut | case outside a switch
CBotErrNoEnd | instructions after final closing brace
CBotErrCloseBlock | missing " } "
CBotErrElseWhitoutIf | else without matching if
CBotErrOpenBlock | missing " { "
CBotErrBadType1 | wrong type for the assignment
CBotErrRedefVar | redefinition of the variable
CBotErrBadType2 | Two operands are incompatible.
CBotErrUndefCall | routine undefined
CBotErrNoDoubleDots | " : " expected
CBotErrNoWhile | "while" expected (in do..while)
CBotErrBreakOutside | break outside of a loop
CBotErrUndefLabel | label udnefined
CBotErrLabel | label ne peut se mettre ici (label can not get here)
CBotErrNoCase | missing " case "
CBotErrBadNum | expected number
CBotErrVoid | " void " not possible here
CBotErrNoType | type declaration expected
CBotErrNoVar | variable name expected
CBotErrNoFunc | expected function name
CBotErrOverParam | too many parameters
CBotErrRedefFunc | this function already exists
CBotErrLowParam | not enough parameters
CBotErrBadParam | wrong types of parameters
CBotErrNbParam | wrong number of parameters
CBotErrUndefItem | element does not exist in the class
CBotErrUndefClass | variable is not a class
CBotErrNoConstruct | no appropriate constructor
CBotErrRedefClass | class already exists
CBotErrCloseIndex | " ] " expected
CBotErrReserved | reserved word (for a DefineNum)
CBotErrBadNew | wrong setting for new
CBotErrOpenIndex | " [ " expected
CBotErrBadString | expected string
CBotErrBadIndex | wrong index type "[ false ]"
CBotErrPrivate | protected item
CBotErrNoPublic | missing word "public"
CBotErrNoExpression | expression expected after =
CBotErrAmbiguousCall | ambiguous call to overloaded function
CBotErrFuncNotVoid | function needs return type "void"
CBotErrNoClassName | class name expected
CBotErrNoReturn | non-void function needs "return;"
CBotErrDefaultValue | this parameter needs a default value
CBotErrEndQuote | missing end quote
CBotErrBadEscape | unknown escape sequence
CBotErrOctalRange | octal value out of range
CBotErrHexDigits | missing hex digits after escape sequence
CBotErrHexRange | hex value out of range
CBotErrUnicodeName | invalid universal character name
CBotErrCharEmpty | empty character constant
CBotErrRedefCase | duplicate label in switch
CBotErrZeroDiv | division by zero
CBotErrNotInit | uninitialized variable
CBotErrBadThrow | throw a negative value
CBotErrNoRetVal | function did not return results
CBotErrNoRun | Run() without active function.
CBotErrUndefFunc | calling a function that no longer exists
CBotErrNotClass | this class does not exist
CBotErrNull | null pointer
CBotErrNan | calculation with a NAN
CBotErrOutArray | index out of array
CBotErrStackOver | stack overflow
CBotErrDeletedPtr | pointer to an object destroyed
CBotErrFileOpen | cannot open the file
CBotErrNotOpen | channel not open
CBotErrRead | error while reading
CBotErrWrite | writing error
CBotErrMAX | Max errors.

## Function Documentation

## WriteWord()

bool CBot::WriteWord | ( | std::ostream & | ostr,
|  | unsigned short | w )

WriteWord.

Parameters

  ostr | Output stream
  w |

Returns
  true on success

## ReadWord()

bool CBot::ReadWord | ( | std::istream & | istr,
|  | unsigned short & | w )

ReadWord.

Parameters

  | istr | Input stream
  [out] | w |

Returns
  true on success

## WriteByte()

bool CBot::WriteByte | ( | std::ostream & | ostr,
|  | char | c )

WriteByte.

Parameters

  ostr | Output stream
  c |

Returns
  true on success

## ReadByte()

bool CBot::ReadByte | ( | std::istream & | istr,
|  | char & | c )

ReadByte.

Parameters

  | istr | Input stream
  [out] | c |

Returns
  true on success

## WriteShort()

bool CBot::WriteShort | ( | std::ostream & | ostr,
|  | short | s )

WriteShort.

Parameters

  ostr | Output stream
  s |

Returns
  true on success

## ReadShort()

bool CBot::ReadShort | ( | std::istream & | istr,
|  | short & | s )

ReadShort.

Parameters

  | istr | Input stream
  [out] | s |

Returns
  true on success

## WriteUInt32()

bool CBot::WriteUInt32 | ( | std::ostream & | ostr,
|  | uint32_t | i )

WriteUInt32.

Parameters

  ostr | Output stream
  i |

Returns
  true on success

## ReadUInt32()

bool CBot::ReadUInt32 | ( | std::istream & | istr,
|  | uint32_t & | i )

ReadUInt32.

Parameters

  | istr | Input stream
  [out] | i |

Returns
  true on success

## WriteInt()

bool CBot::WriteInt | ( | std::ostream & | ostr,
|  | int | i )

WriteInt.

Parameters

  ostr | Output stream
  i |

Returns
  true on success

## ReadInt()

bool CBot::ReadInt | ( | std::istream & | istr,
|  | int & | i )

ReadInt.

Parameters

  | istr | Input stream
  [out] | i |

Returns
  true on success

## WriteLong()

bool CBot::WriteLong | ( | std::ostream & | ostr,
|  | long | l,
|  | unsigned | padTo = 0 )

WriteLong.

Parameters

  ostr | Output stream
  l |
  padTo | minimum number of bytes to write

Returns
  true on success

## ReadLong()

bool CBot::ReadLong | ( | std::istream & | istr,
|  | long & | l )

ReadLong.

Parameters

  | istr | Input stream
  [out] | l |

Returns
  true on success

## WriteFloat()

bool CBot::WriteFloat | ( | std::ostream & | ostr,
|  | float | f )

WriteFloat.

Parameters

  ostr | Output stream
  f |

Returns
  true on success

## ReadFloat()

bool CBot::ReadFloat | ( | std::istream & | istr,
|  | float & | f )

ReadFloat.

Parameters

  | istr | Input stream
  [out] | f |

Returns
  true on success

## WriteDouble()

bool CBot::WriteDouble | ( | std::ostream & | ostr,
|  | double | d )

WriteDouble.

Parameters

  ostr | Output stream
  d |

Returns
  true on success

## ReadDouble()

bool CBot::ReadDouble | ( | std::istream & | istr,
|  | double & | d )

ReadDouble.

Parameters

  | istr | Input stream
  [out] | d |

Returns
  true on success

## WriteString()

bool CBot::WriteString | ( | std::ostream & | ostr,
|  | const std::string & | s )

WriteString.

Parameters

  ostr | Output stream
  s |

Returns
  true on success

## ReadString()

bool CBot::ReadString | ( | std::istream & | istr,
|  | std::string & | s )

ReadString.

Parameters

  | istr | Input stream
  [out] | s |

Returns
  true on success

## WriteType()

bool CBot::WriteType | ( | std::ostream & | ostr,
|  | const CBotTypResult & | type )

WriteType.

Parameters

  ostr | Output stream
  type |

Returns
  true on success

## ReadType()

bool CBot::ReadType | ( | std::istream & | istr,
|  | CBotTypResult & | type )

ReadType.

Parameters

  | istr | Input stream
  [out] | type |

Returns
  true on success

## WriteStream()

bool CBot::WriteStream | ( | std::ostream & | ostr,
|  | std::istream & | istr )

WriteStream.

Parameters

  ostr | Output stream
  istr | Input stream

Returns
  true on success

## ReadStream()

bool CBot::ReadStream | ( | std::istream & | istr,
|  | std::ostream & | ostr )

ReadStream.

Parameters

  istr | Input stream
  ostr | Output stream

Returns
  true on success

## SaveVars()

bool CBot::SaveVars | ( | std::ostream & | ostr,
|  | CBotVar * | pVar )

Save a linked list if variables.

Parameters

  ostr | Output stream
  pVar | First variable in the list

Returns
  true on success

## CompileParams()

CBotInstr * CBot::CompileParams | ( | CBotToken *& | p,
|  | CBotCStack * | pStack,
|  | CBotVar ** | ppVars )

CompileParams Compile a list of parameters.

Parameters

  p |
  pStack |
  ppVars |

Returns

## TypeCompatible()

bool CBot::TypeCompatible | ( | CBotTypResult & | type1,
|  | CBotTypResult & | type2,
|  | int | op = 0 )

TypeCompatible Check if two results are consistent to make an operation. TypeCompatible is used in two ways: For non-assignment operations: see CBotTwoOpExpr::Compile TypeCompatible( leftType, rightType, opType ).

For assignment or compound assignment operations (it's reversed): see CBotReturn::Compile & CBotExpression::Compile TypeCompatible( valueType, varType, opType )

Parameters

  type1 |
  type2 |
  op |

Returns

## TypesCompatibles()

bool CBot::TypesCompatibles | ( | const CBotTypResult & | type1,
|  | const CBotTypResult & | type2 )

TypesCompatibles Check if two variables are compatible for parameter passing.

Parameters

  type1 |
  type2 |

Returns

## LoadString()

const std::string & CBot::LoadString | ( | TokenId | id | ) |

Maps given ID to its string equivalent.

Parameters

  id | Token type identifier

Returns
  String if found, empty string otherwise

## IsOfType()

bool CBot::IsOfType | ( | CBotToken *& | p,
|  | int | type1,
|  | int | type2 = -1 )

Check if this token is of specified type.

Parameters

  p | The token to compare
  type1 | First token type to comapre to the token
  type2 | Second token type to comapre to the token

Returns
  true if the type of the token matches one of the parameters

## IsOfTypeList()

bool CBot::IsOfTypeList | ( | CBotToken *& | p,
|  | int | type1,
|  |  | ... )

Check if this token is of specified type.

Parameters

  p | The token to compare
  type1 | The list of token types to comapre to the token, 0-terminated

Returns
  true if the type of the tokens matched one of the parameters

## MakeListVars()

CBotVar * CBot::MakeListVars | ( | CBotVar ** | ppVars,
|  | bool | bSetVal = false )

MakeListVars Transforms the array of pointers to variables in a chained list of variables.

Parameters

  ppVars |
  bSetVal |

Returns

## TypeParam()

CBotTypResult CBot::TypeParam | ( | CBotToken *& | p,
|  | CBotCStack * | pile )

TypeParam.

Parameters

  p |
  pile |

Returns

## ArrayType()

CBotTypResult CBot::ArrayType | ( | CBotToken *& | p,
|  | CBotCStack * | pile,
|  | CBotTypResult | type )

ArrayType.

Parameters

  p |
  pile |
  type |

Returns

## GetNumInt()

long CBot::GetNumInt | ( | const std::string & | str | ) |

GetNumInt Converts a string into integer may be of the form 0xabc123.

Parameters

  str |

Returns

## GetNumFloat()

double CBot::GetNumFloat | ( | const std::string & | str | ) |

GetNumFloat Converts a string into a float number.

Parameters

  str |

Returns

## CharInList()

bool CBot::CharInList | ( | const char | c,
|  | const char * | list )

Search a null-terminated string for a char value.

Parameters

  c | The char to find.
  list | The string to search.

Returns
  true if the char is found.

## CodePointToUTF8()

std::string CBot::CodePointToUTF8 | ( | unsigned int | val | ) |

Converts a Unicode code point to UTF-8 encoded character.

Parameters

  val | Code point value.

Returns
  UTF-8 encoded string or empty string.