Colobot
Classes | Enumerations | Functions | Variables
CBot Namespace Reference

CBot engine. More...

Classes

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  CBotCallMethode
 The CBotCallMethode class Class managing the methods declared by AddFunction on a class. More...
 
class  CBotCase
 Instruction "case", part of "switch" structure. More...
 
class  CBotCatch
 Instruction "catch", part of "try" structure. More...
 
class  CBotClass
 A CBot class definition. More...
 
class  CBotCondition
 A condition - boolean expression enclosed in brackets - (condition) More...
 
class  CBotCStack
 The CBotCStack class Management of the stack of compilation. More...
 
class  CBotDebug
 Various utilities used for debugging. 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  CBotDefParam
 The CBotDefParam class A list of parameters. More...
 
class  CBotDefString
 Definition of a string variable - string a, b = "text";. More...
 
class  CBotDo
 do {...} while (...) structure More...
 
class  CBotDoublyLinkedList
 
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  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  CBotExprUnaire
 Unary expression - +a, -a, !a, ~a, not a. More...
 
class  CBotExprVar
 Expression representing a variable name. More...
 
class  CBotExternalCall
 Interface for external CBot calls. More...
 
class  CBotExternalCallDefault
 Default implementation of CBot external call, using compilation and runtime functions. More...
 
class  CBotExternalCallList
 Class for mangaging CBot external calls. More...
 
class  CBotFieldExpr
 Accessing a class field using dot operator - toto.x. More...
 
class  CBotFile
 
class  CBotFileAccessHandler
 
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  CBotLinkedList
 
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  CBotProgram
 Class that manages a CBot program. This is the main entry point into the CBot engine. More...
 
class  CBotReturn
 The "return" instruction. More...
 
class  CBotStack
 The execution stack. More...
 
class  CBotSwitch
 The switch structure. More...
 
class  CBotThrow
 The "throw" instruction. More...
 
class  CBotToken
 Class representing one token of a program. More...
 
class  CBotTry
 The "try" structure. More...
 
class  CBotTwoOpExpr
 Any expression with two operands. More...
 
class  CBotTypResult
 Class to define the complete type of a variable. More...
 
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  CBotVarClass
 CBotVar subclass for managing classes (CBotTypClass, CBotTypIntrinsic) More...
 
class  CBotVarFloat
 CBotVar subclass for managing float values (CBotTypFloat) More...
 
class  CBotVarInt
 CBotVar subclass for managing integer values (CBotTypInt) More...
 
class  CBotVarNumber
 A number variable (int, float) More...
 
class  CBotVarNumberBase
 A number based variable (bool, int, float) More...
 
class  CBotVarPointer
 CBotVar subclass for managing pointers to classes (CBotTypPointer) 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  CBotWhile
 The "while" loop - while (condition) { ... }. More...
 

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_INT, ID_FLOAT, ID_BOOLEAN, ID_STRING,
  ID_VOID, ID_BOOL, 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
}
 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, 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

FILE * fOpen (const char *name, const char *mode)
 fOpen More...
 
int fClose (FILE *filehandle)
 fClose More...
 
std::size_t fWrite (const void *buffer, std::size_t elemsize, std::size_t length, FILE *filehandle)
 fWrite More...
 
std::size_t fRead (void *buffer, std::size_t elemsize, std::size_t length, FILE *filehandle)
 fRead More...
 
bool ReadWord (FILE *pf, unsigned short &w)
 ReadWord. More...
 
bool ReadFloat (FILE *pf, float &w)
 ReadFloat. More...
 
bool WriteLong (FILE *pf, long w)
 WriteLong. More...
 
bool ReadLong (FILE *pf, long &w)
 ReadLong. More...
 
bool ReadString (FILE *pf, std::string &s)
 ReadString. More...
 
bool WriteType (FILE *pf, const CBotTypResult &type)
 WriteType. More...
 
bool ReadType (FILE *pf, CBotTypResult &type)
 ReadType. More...
 
bool SaveVars (FILE *pf, CBotVar *pVar)
 SaveVars. More...
 
bool WriteWord (FILE *pf, unsigned short w)
 WriteWord. More...
 
bool WriteFloat (FILE *pf, float w)
 WriteFloat. More...
 
CBotInstrCompileParams (CBotToken *&p, CBotCStack *pStack, CBotVar **ppVars)
 CompileParams Compile a list of parameters. More...
 
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 ) More...
 
bool TypesCompatibles (const CBotTypResult &type1, const CBotTypResult &type2)
 TypesCompatibles Check if two variables are compatible for parameter passing. More...
 
bool IsInList (int val, int *list, int &typeMask)
 
bool TypeOk (int type, int test)
 
bool VarIsNAN (const CBotVar *var)
 
bool IsNan (CBotVar *left, CBotVar *right, CBotError *err=nullptr)
 
CBotTypResult cSizeOf (CBotVar *&pVar, void *pUser)
 
bool rSizeOf (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
const std::string & LoadString (TokenId id)
 Maps given ID to its string equivalent. More...
 
bool CharInList (const char c, const char *list)
 
bool IsOfType (CBotToken *&p, int type1, int type2=-1)
 Check if this token is of specified type. More...
 
bool IsOfTypeList (CBotToken *&p, int type1,...)
 Check if this token is of specified type. More...
 
CBotVarMakeListVars (CBotVar **ppVars, bool bSetVal=false)
 MakeListVars Transforms the array of pointers to variables in a chained list of variables. More...
 
CBotTypResult TypeParam (CBotToken *&p, CBotCStack *pile)
 TypeParam. More...
 
CBotTypResult ArrayType (CBotToken *&p, CBotCStack *pile, CBotTypResult type)
 ArrayType. More...
 
bool WriteString (FILE *pf, std::string s)
 WriteString. More...
 
long GetNumInt (const std::string &str)
 GetNumInt Converts a string into integer may be of the form 0xabc123. More...
 
float GetNumFloat (const std::string &str)
 GetNumFloat Converts a string into a float number. More...
 
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)
 
bool FileClassOpenFile (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception)
 
bool rfconstruct (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfconstruct (CBotVar *pThis, CBotVar *&pVar)
 
bool rfdestruct (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
bool rfopen (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfopen (CBotVar *pThis, CBotVar *&pVar)
 
bool rfclose (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfclose (CBotVar *pThis, CBotVar *&pVar)
 
bool rfwrite (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfwrite (CBotVar *pThis, CBotVar *&pVar)
 
bool rfread (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfread (CBotVar *pThis, CBotVar *&pVar)
 
bool rfeof (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
CBotTypResult cfeof (CBotVar *pThis, CBotVar *&pVar)
 
bool rDeleteFile (CBotVar *var, CBotVar *result, int &exception, void *user)
 
void InitFileFunctions ()
 
void SetFileAccessHandler (std::unique_ptr< CBotFileAccessHandler > fileHandler)
 
bool rSin (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rCos (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rTan (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool raSin (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool raCos (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool raTan (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool raTan2 (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rSqrt (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rPow (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rRand (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rAbs (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rFloor (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rCeil (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rRound (CBotVar *var, CBotVar *result, int &exception, void *user)
 
bool rTrunc (CBotVar *var, CBotVar *result, int &exception, void *user)
 
void InitMathFunctions ()
 
void InitStringFunctions ()
 
bool rStrLen (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrLeft (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrRight (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrMid (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrVal (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrFind (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrUpper (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 
bool rStrLower (CBotVar *pVar, CBotVar *pResult, int &ex, void *pUser)
 

Variables

const int DEFAULT_TIMER = 100
 
const float PI = 3.14159265358979323846f
 

Detailed Description

CBot engine.

Enumeration Type Documentation

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

Do not change the order of elements.

Enumerator
CBotTypVoid 

void

CBotTypByte 

byte (NOT IMPLEMENTED)

CBotTypShort 

short (NOT IMPLEMENTED)

CBotTypChar 

char (NOT IMPLEMENTED)

CBotTypInt 

int

CBotTypLong 

long (NOT IMPLEMENTED)

CBotTypFloat 

float

CBotTypDouble 

double (NOT IMPLEMENTED)

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.

Different modes for CBotProgram::GetPosition.

This enum contains possible token types.

Enumerator
TokenKeyWord 

keywords

TokenKeyVal 

keywords that represent values (true, false, null, nan)

TokenKeyOp 

operators

Types of tokens.

Enumerator
TokenTypKeyWord 

keyword of the language (see TokenKeyWord)

TokenTypNum 

number

TokenTypString 

string

TokenTypVar 

a variable name

TokenTypDef 

value according DefineNum

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 =

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

FILE * CBot::fOpen ( const char *  name,
const char *  mode 
)

fOpen

Parameters
name
mode
Returns
int CBot::fClose ( FILE *  filehandle)

fClose

Parameters
filehandle
Returns
std::size_t CBot::fWrite ( const void *  buffer,
std::size_t  elemsize,
std::size_t  length,
FILE *  filehandle 
)

fWrite

Parameters
buffer
elemsize
length
filehandle
Returns
std::size_t CBot::fRead ( void *  buffer,
std::size_t  elemsize,
std::size_t  length,
FILE *  filehandle 
)

fRead

Parameters
buffer
elemsize
length
filehandle
Returns
bool CBot::ReadWord ( FILE *  pf,
unsigned short &  w 
)

ReadWord.

Parameters
pf
w
Returns
bool CBot::ReadFloat ( FILE *  pf,
float &  w 
)

ReadFloat.

Parameters
pf
w
Returns
bool CBot::WriteLong ( FILE *  pf,
long  w 
)

WriteLong.

Parameters
pf
w
Returns
bool CBot::ReadLong ( FILE *  pf,
long &  w 
)

ReadLong.

Parameters
pf
w
Returns
bool CBot::ReadString ( FILE *  pf,
std::string &  s 
)

ReadString.

Parameters
pf
s
Returns
bool CBot::WriteType ( FILE *  pf,
const CBotTypResult type 
)

WriteType.

Parameters
pf
type
Returns
bool CBot::ReadType ( FILE *  pf,
CBotTypResult type 
)

ReadType.

Parameters
pf
type
Returns
bool CBot::SaveVars ( FILE *  pf,
CBotVar pVar 
)

SaveVars.

Parameters
pf
pVar
Returns
bool CBot::WriteWord ( FILE *  pf,
unsigned short  w 
)

WriteWord.

Parameters
pf
w
Returns
bool CBot::WriteFloat ( FILE *  pf,
float  w 
)

WriteFloat.

Parameters
pf
w
Returns
CBotInstr * CBot::CompileParams ( CBotToken *&  p,
CBotCStack pStack,
CBotVar **  ppVars 
)

CompileParams Compile a list of parameters.

Parameters
p
pStack
ppVars
Returns
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
bool CBot::TypesCompatibles ( const CBotTypResult type1,
const CBotTypResult type2 
)

TypesCompatibles Check if two variables are compatible for parameter passing.

Parameters
type1
type2
Returns
const std::string & CBot::LoadString ( TokenId  id)

Maps given ID to its string equivalent.

Parameters
idToken type identifier
Returns
String if found, empty string otherwise
bool CBot::IsOfType ( CBotToken *&  p,
int  type1,
int  type2 = -1 
)

Check if this token is of specified type.

Parameters
pThe token to compare
type1First token type to comapre to the token
type2Second token type to comapre to the token
Returns
true if the type of the token matches one of the parameters
bool CBot::IsOfTypeList ( CBotToken *&  p,
int  type1,
  ... 
)

Check if this token is of specified type.

Parameters
pThe token to compare
type1The list of token types to comapre to the token, 0-terminated
Returns
true if the type of the tokens matched one of the parameters
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
CBotTypResult CBot::TypeParam ( CBotToken *&  p,
CBotCStack pile 
)

TypeParam.

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

ArrayType.

Parameters
p
pile
type
Returns
bool CBot::WriteString ( FILE *  pf,
std::string  s 
)

WriteString.

Parameters
pf
s
Returns
long CBot::GetNumInt ( const std::string &  str)

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

Parameters
str
Returns
float CBot::GetNumFloat ( const std::string &  str)

GetNumFloat Converts a string into a float number.

Parameters
str
Returns