summaryrefslogtreecommitdiffstats
path: root/src/CBot/CBot.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CBot/CBot.h')
-rw-r--r--src/CBot/CBot.h522
1 files changed, 266 insertions, 256 deletions
diff --git a/src/CBot/CBot.h b/src/CBot/CBot.h
index 7e15f65..6f18be8 100644
--- a/src/CBot/CBot.h
+++ b/src/CBot/CBot.h
@@ -17,15 +17,15 @@
// dernière révision : 03/10/2002 DD
-#define EXTENDS TRUE
+#define EXTENDS true
#include "resource.h"
#include "CBotDll.h" // définitions publiques
#include "CBotToken.h" // gestion des tokens
-#define STACKRUN TRUE // reprise de l'exécution direct sur une routine suspendue
-#define STACKMEM TRUE // préréserve la mémoire pour la pile d'exécution
+#define STACKRUN true // reprise de l'exécution direct sur une routine suspendue
+#define STACKMEM true // préréserve la mémoire pour la pile d'exécution
#define MAXSTACK 990 // taille du stack réservé
#define EOX (CBotStack*)-1 // marqueur condition spéciale
@@ -61,12 +61,13 @@ class CBotRepeat; // repeat (nb) {...}
////////////////////////////////////////////////////////////////////////
-// Gestion de la pile d'exécution
+// Management of the execution stack
////////////////////////////////////////////////////////////////////////
-// en fait, en externe, la seule chose qu'il est possible de faire
-// c'est de créer une instance d'une pile
-// pour l'utiliser pour la routine CBotProgram::Execute(CBotStack)
+// actually, externally, the only thing he can do
+// this is to create an instance of a stack
+// to use for routine CBotProgram :: Execute (CBotStack)
+
class CBotStack
{
@@ -90,9 +91,9 @@ private:
CBotVar* m_var; // résultat des opérations
CBotVar* m_listVar; // les variables déclarées à ce niveau
- BOOL m_bBlock; // fait partie d'un bloc (variables sont locales à ce bloc)
- BOOL m_bOver; // limites de la pile ?
-// BOOL m_bDontDelete; // spécial, ne pas détruire les variables au delete
+ bool m_bBlock; // fait partie d'un bloc (variables sont locales à ce bloc)
+ bool m_bOver; // limites de la pile ?
+// bool m_bDontDelete; // spécial, ne pas détruire les variables au delete
CBotProgram* m_prog; // les fonctions définies par user
static
@@ -105,7 +106,7 @@ private:
void* m_pUser;
CBotInstr* m_instr; // l'instruction correspondante
- BOOL m_bFunc; // une entrée d'une fonction ?
+ bool m_bFunc; // une entrée d'une fonction ?
CBotCall* m_call; // point de reprise dans un call extern
friend class CBotTry;
@@ -117,7 +118,7 @@ public:
#endif
CBotStack(CBotStack* ppapa);
~CBotStack();
- BOOL StackOver();
+ bool StackOver();
int GivError(int& start, int& end);
int GivError(); // rend le numéro d'erreur retourné
@@ -127,48 +128,48 @@ public:
int GivType(int mode = 0); // donne le type de valeur sur le stack
CBotTypResult GivTypResult(int mode = 0); // donne le type complet de valeur sur le stack
-// void AddVar(CBotVar* p, BOOL bDontDelete=FALSE); // ajoute une variable locale
+// void AddVar(CBotVar* p, bool bDontDelete=false); // ajoute une variable locale
void AddVar(CBotVar* p); // ajoute une variable locale
// void RestoreVar(CBotVar* pVar);
- CBotVar* FindVar(CBotToken* &p, BOOL bUpdate = FALSE,
- BOOL bModif = FALSE); // trouve une variable
- CBotVar* FindVar(CBotToken& Token, BOOL bUpdate = FALSE,
- BOOL bModif = FALSE);
+ CBotVar* FindVar(CBotToken* &p, bool bUpdate = false,
+ bool bModif = false); // trouve une variable
+ CBotVar* FindVar(CBotToken& Token, bool bUpdate = false,
+ bool bModif = false);
CBotVar* FindVar(const char* name);
- CBotVar* FindVar(long ident, BOOL bUpdate = FALSE,
- BOOL bModif = FALSE);
+ CBotVar* FindVar(long ident, bool bUpdate = false,
+ bool bModif = false);
- CBotVar* CopyVar(CBotToken& Token, BOOL bUpdate = FALSE); // trouve et rend une copie
+ CBotVar* CopyVar(CBotToken& Token, bool bUpdate = false); // trouve et rend une copie
- CBotStack* AddStack(CBotInstr* instr = NULL, BOOL bBlock = FALSE); // étend le stack
- CBotStack* AddStackEOX(CBotCall* instr = NULL, BOOL bBlock = FALSE); // étend le stack
+ CBotStack* AddStack(CBotInstr* instr = NULL, bool bBlock = false); // étend le stack
+ CBotStack* AddStackEOX(CBotCall* instr = NULL, bool bBlock = false); // étend le stack
CBotStack* RestoreStack(CBotInstr* instr = NULL);
CBotStack* RestoreStackEOX(CBotCall* instr = NULL);
- CBotStack* AddStack2(BOOL bBlock = FALSE); // étend le stack
- BOOL Return(CBotStack* pFils); // transmet le résultat au dessus
- BOOL ReturnKeep(CBotStack* pFils); // transmet le résultat sans réduire la pile
- BOOL BreakReturn(CBotStack* pfils, const char* name = NULL);
+ CBotStack* AddStack2(bool bBlock = false); // étend le stack
+ bool Return(CBotStack* pFils); // transmet le résultat au dessus
+ bool ReturnKeep(CBotStack* pFils); // transmet le résultat sans réduire la pile
+ bool BreakReturn(CBotStack* pfils, const char* name = NULL);
// en cas de break éventuel
- BOOL IfContinue(int state, const char* name);
+ bool IfContinue(int state, const char* name);
// ou de "continue"
- BOOL IsOk();
+ bool IsOk();
- BOOL SetState(int n, int lim = -10); // sélectionne un état
+ bool SetState(int n, int lim = -10); // sélectionne un état
int GivState(); // dans quel état j'ère ?
- BOOL IncState(int lim = -10); // passe à l'état suivant
- BOOL IfStep(); // faire du pas à pas ?
- BOOL Execute();
+ bool IncState(int lim = -10); // passe à l'état suivant
+ bool IfStep(); // faire du pas à pas ?
+ bool Execute();
void SetVar( CBotVar* var );
void SetCopyVar( CBotVar* var );
CBotVar* GivVar();
CBotVar* GivCopyVar();
CBotVar* GivPtVar();
- BOOL GivRetVar(BOOL bRet);
+ bool GivRetVar(bool bRet);
long GivVal();
void SetStartError(int pos);
@@ -178,17 +179,17 @@ public:
void SetBreak(int val, const char* name);
void SetBotCall(CBotProgram* p);
- CBotProgram* GivBotCall(BOOL bFirst = FALSE);
+ CBotProgram* GivBotCall(bool bFirst = false);
void* GivPUser();
- BOOL GivBlock();
+ bool GivBlock();
-// BOOL ExecuteCall(CBotToken* token, CBotVar** ppVar, CBotTypResult& rettype);
- BOOL ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotTypResult& rettype);
+// bool ExecuteCall(CBotToken* token, CBotVar** ppVar, CBotTypResult& rettype);
+ bool ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotTypResult& rettype);
void RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar);
- BOOL SaveState(FILE* pf);
- BOOL RestoreState(FILE* pf, CBotStack* &pStack);
+ bool SaveState(FILE* pf);
+ bool RestoreState(FILE* pf, CBotStack* &pStack);
static
void SetTimer(int n);
@@ -201,7 +202,7 @@ public:
// les routines inline doivent être déclarées dans le fichier .h
-inline BOOL CBotStack::IsOk()
+inline bool CBotStack::IsOk()
{
return (m_error == 0);
}
@@ -235,7 +236,7 @@ private:
CBotVar* m_var; // résultat des opérations
- BOOL m_bBlock; // fait partie d'un bloc (variables sont locales à ce bloc)
+ bool m_bBlock; // fait partie d'un bloc (variables sont locales à ce bloc)
CBotVar* m_listVar;
static
@@ -249,7 +250,7 @@ public:
CBotCStack(CBotCStack* ppapa);
~CBotCStack();
- BOOL IsOk();
+ bool IsOk();
int GivError();
int GivError(int& start, int& end);
// rend le numéro d'erreur retourné
@@ -262,10 +263,10 @@ public:
void AddVar(CBotVar* p); // ajoute une variable locale
CBotVar* FindVar(CBotToken* &p); // trouve une variable
CBotVar* FindVar(CBotToken& Token);
- BOOL CheckVarLocal(CBotToken* &pToken);
+ bool CheckVarLocal(CBotToken* &pToken);
CBotVar* CopyVar(CBotToken& Token); // trouve et rend une copie
- CBotCStack* TokenStack(CBotToken* pToken = NULL, BOOL bBlock = FALSE);
+ CBotCStack* TokenStack(CBotToken* pToken = NULL, bool bBlock = false);
CBotInstr* Return(CBotInstr* p, CBotCStack* pParent); // transmet le résultat au dessus
CBotFunction* ReturnFunc(CBotFunction* p, CBotCStack* pParent); // transmet le résultat au dessus
@@ -285,17 +286,17 @@ public:
void SetBotCall(CBotProgram* p);
CBotProgram* GivBotCall();
CBotTypResult CompileCall(CBotToken* &p, CBotVar** ppVars, long& nIdent);
- BOOL CheckCall(CBotToken* &pToken, CBotDefParam* pParam);
+ bool CheckCall(CBotToken* &pToken, CBotDefParam* pParam);
- BOOL NextToken(CBotToken* &p);
+ bool NextToken(CBotToken* &p);
};
-extern BOOL SaveVar(FILE* pf, CBotVar* pVar);
+extern bool SaveVar(FILE* pf, CBotVar* pVar);
/////////////////////////////////////////////////////////////////////
-// classes définissant une instruction
+// classes defining an instruction
class CBotInstr
{
private:
@@ -303,17 +304,17 @@ private:
CBotStringArray
m_labelLvl;
protected:
- CBotToken m_token; // conserve le token
+ CBotToken m_token; // keeps the token
CBotString name; // debug
- CBotInstr* m_next; // instructions chaînées
- CBotInstr* m_next2b; // seconde liste pour définition en chaîne
- CBotInstr* m_next3; // troisième liste pour les indices et champs
- CBotInstr* m_next3b; // nécessaire pour la déclaration des tableaux
+ CBotInstr* m_next; // linked command
+ CBotInstr* m_next2b; // second list definition chain
+ CBotInstr* m_next3; // third list for indices and fields
+ CBotInstr* m_next3b; // necessary for reporting tables
/*
- par exemple, le programme suivant
+ for example, the following program
int x[]; x[1] = 4;
int y[x[1]][10], z;
- va généré
+ is generated
CBotInstrArray
m_next3b-> CBotEmpty
m_next->
@@ -338,31 +339,30 @@ public:
virtual
~CBotInstr();
- DllExport//debug
+// DllExport//debug
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
static
- CBotInstr* CompileArray(CBotToken* &p, CBotCStack* pStack, CBotTypResult type, BOOL first = TRUE);
+ CBotInstr* CompileArray(CBotToken* &p, CBotCStack* pStack, CBotTypResult type, bool first = true);
virtual
- BOOL Execute(CBotStack* &pj);
+ bool Execute(CBotStack* &pj);
virtual
- BOOL Execute(CBotStack* &pj, CBotVar* pVar);
+ bool Execute(CBotStack* &pj, CBotVar* pVar);
virtual
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ void RestoreState(CBotStack* &pj, bool bMain);
virtual
- BOOL ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
+ bool ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
virtual
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, BOOL bStep, BOOL bExtend);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep, bool bExtend);
virtual
- void RestoreStateVar(CBotStack* &pile, BOOL bMain);
+ void RestoreStateVar(CBotStack* &pile, bool bMain);
virtual
- BOOL CompCase(CBotStack* &pj, int val);
+ bool CompCase(CBotStack* &pj, int val);
void SetToken(CBotToken* p);
- void SetToken(CBotString* name, int start=0, int end=0);
int GivTokenType();
CBotToken* GivToken();
@@ -380,9 +380,9 @@ public:
static
void DecLvl();
static
- BOOL ChkLvl(const CBotString& label, int type);
+ bool ChkLvl(const CBotString& label, int type);
- BOOL IsOfClass(CBotString name);
+ bool IsOfClass(CBotString name);
};
class CBotWhile : public CBotInstr
@@ -397,24 +397,34 @@ public:
~CBotWhile();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotRepeat : public CBotInstr
{
private:
- CBotInstr* m_NbIter; // le nombre d'itération
- CBotInstr* m_Block; // les instructions
- CBotString m_label; // une étiquette s'il y a
+ /// Number of iterations
+ CBotInstr* m_NbIter;
+
+ /// Instructions
+ CBotInstr* m_Block;
+
+ /// Label
+ CBotString m_label; // une étiquette s'il y a
public:
- CBotRepeat();
- ~CBotRepeat();
- static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotRepeat();
+ ~CBotRepeat();
+
+ /// Static method used for compilation
+ static CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
+
+ /// Execute
+ bool Execute(CBotStack* &pj);
+
+ /// Restore state
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotDo : public CBotInstr
@@ -429,8 +439,8 @@ public:
~CBotDo();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotFor : public CBotInstr
@@ -447,8 +457,8 @@ public:
~CBotFor();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotBreak : public CBotInstr
@@ -461,8 +471,8 @@ public:
~CBotBreak();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotReturn : public CBotInstr
@@ -475,8 +485,8 @@ public:
~CBotReturn();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -491,8 +501,8 @@ public:
~CBotSwitch();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -506,9 +516,9 @@ public:
~CBotCase();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
- BOOL CompCase(CBotStack* &pj, int val);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
+ bool CompCase(CBotStack* &pj, int val);
};
class CBotCatch : public CBotInstr
@@ -524,10 +534,10 @@ public:
~CBotCatch();
static
CBotCatch* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL TestCatch(CBotStack* &pj, int val);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
- void RestoreCondState(CBotStack* &pj, BOOL bMain);
+ bool TestCatch(CBotStack* &pj, int val);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
+ void RestoreCondState(CBotStack* &pj, bool bMain);
};
class CBotTry : public CBotInstr
@@ -542,8 +552,8 @@ public:
~CBotTry();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotThrow : public CBotInstr
@@ -556,8 +566,8 @@ public:
~CBotThrow();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -570,7 +580,7 @@ public:
~CBotStartDebugDD();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
+ bool Execute(CBotStack* &pj);
};
@@ -586,8 +596,8 @@ public:
~CBotIf();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -604,9 +614,9 @@ public:
CBotInt();
~CBotInt();
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL cont = FALSE, BOOL noskip = FALSE);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool cont = false, bool noskip = false);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// définition d'un tableau
@@ -625,8 +635,8 @@ public:
~CBotInstArray();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResult type);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -643,15 +653,15 @@ public:
~CBotListArray();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResult type);
- BOOL Execute(CBotStack* &pj, CBotVar* pVar);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj, CBotVar* pVar);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotEmpty : public CBotInstr
{
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// définition d'un booléen
@@ -666,9 +676,9 @@ public:
CBotBoolean();
~CBotBoolean();
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL cont = FALSE, BOOL noskip=FALSE);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool cont = false, bool noskip=false);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -684,9 +694,9 @@ public:
CBotFloat();
~CBotFloat();
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL cont = FALSE, BOOL noskip=FALSE);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool cont = false, bool noskip=false);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// définition d'un elément string
@@ -701,9 +711,9 @@ public:
CBotIString();
~CBotIString();
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL cont = FALSE, BOOL noskip=FALSE);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool cont = false, bool noskip=false);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// définition d'un elément dans une classe quelconque
@@ -715,7 +725,7 @@ private:
CBotClass* m_pClass; // référence à la classe
CBotInstr* m_Parameters; // les paramètres à évaluer pour le constructeur
CBotInstr* m_expr; // la valeur à mettre, s'il y a
- BOOL m_hasParams; // il y a des paramètres ?
+ bool m_hasParams; // il y a des paramètres ?
long m_nMethodeIdent;
public:
@@ -723,8 +733,8 @@ public:
~CBotClassInst();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, CBotClass* pClass = NULL);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotCondition : public CBotInstr
@@ -751,11 +761,11 @@ public:
~CBotLeftExpr();
static
CBotLeftExpr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pStack, CBotStack* array);
+ bool Execute(CBotStack* &pStack, CBotStack* array);
- BOOL ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, BOOL bStep);
- void RestoreStateVar(CBotStack* &pile, BOOL bMain);
+ bool ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep);
+ void RestoreStateVar(CBotStack* &pile, bool bMain);
};
@@ -773,9 +783,9 @@ public:
void SetUniqNum(int num);
// static
// CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, BOOL bStep, BOOL bExtend);
- void RestoreStateVar(CBotStack* &pj, BOOL bMain);
+ bool ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep, bool bExtend);
+ void RestoreStateVar(CBotStack* &pj, bool bMain);
};
// gestion des index dans les tableaux
@@ -792,9 +802,9 @@ public:
~CBotIndexExpr();
// static
// CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, BOOL bStep, BOOL bExtend);
- void RestoreStateVar(CBotStack* &pj, BOOL bMain);
+ bool ExecuteVar(CBotVar* &pVar, CBotCStack* &pile);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep, bool bExtend);
+ void RestoreStateVar(CBotStack* &pj, bool bMain);
};
// une expression du genre
@@ -812,8 +822,8 @@ public:
~CBotExpression();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pStack);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pStack);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotListExpression : public CBotInstr
@@ -826,8 +836,8 @@ public:
~CBotListExpression();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pStack);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pStack);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotLogicExpr : public CBotInstr
@@ -843,8 +853,8 @@ public:
~CBotLogicExpr();
// static
// CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pStack);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pStack);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -882,8 +892,8 @@ public:
~CBotExprUnaire();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pStack);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pStack);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// toutes les opérations à 2 opérandes
@@ -898,8 +908,8 @@ public:
~CBotTwoOpExpr();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, int* pOperations = NULL);
- BOOL Execute(CBotStack* &pStack);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pStack);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -912,9 +922,9 @@ private:
public:
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL bLocal = TRUE);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool bLocal = true);
static
- CBotInstr* CompileBlkOrInst(CBotToken* &p, CBotCStack* pStack, BOOL bLocal = FALSE);
+ CBotInstr* CompileBlkOrInst(CBotToken* &p, CBotCStack* pStack, bool bLocal = false);
};
@@ -928,9 +938,9 @@ public:
CBotListInstr();
~CBotListInstr();
static
- CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, BOOL bLocal = TRUE);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, bool bLocal = true);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -949,8 +959,8 @@ public:
~CBotInstrCall();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// un appel d'une méthode
@@ -974,12 +984,12 @@ public:
~CBotInstrMethode();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack, CBotVar* pVar);
- BOOL Execute(CBotStack* &pj);
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToken, BOOL bStep, BOOL bExtend);
- void RestoreStateVar(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToken, bool bStep, bool bExtend);
+ void RestoreStateVar(CBotStack* &pj, bool bMain);
};
-// expression donnant un nom de variable
+// expression for the variable name
class CBotExprVar : public CBotInstr
{
@@ -996,11 +1006,11 @@ public:
static
CBotInstr* CompileMethode(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
- BOOL ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, BOOL bStep);
- BOOL Execute2Var(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToken, BOOL bStep);
- void RestoreStateVar(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
+ bool ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prevToken, bool bStep);
+ bool Execute2Var(CBotVar* &pVar, CBotStack* &pj, CBotToken* prevToken, bool bStep);
+ void RestoreStateVar(CBotStack* &pj, bool bMain);
};
class CBotPostIncExpr : public CBotInstr
@@ -1014,8 +1024,8 @@ public:
~CBotPostIncExpr();
// static
// CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotPreIncExpr : public CBotInstr
@@ -1029,8 +1039,8 @@ public:
~CBotPreIncExpr();
// static
// CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -1047,8 +1057,8 @@ public:
~CBotLeftExprVar();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -1062,8 +1072,8 @@ public:
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -1075,8 +1085,8 @@ public:
CBotExprNull();
~CBotExprNull();
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotExprNan : public CBotInstr
@@ -1087,8 +1097,8 @@ public:
CBotExprNan();
~CBotExprNan();
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
class CBotNew : public CBotInstr
@@ -1105,8 +1115,8 @@ public:
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
// expression représentant un nombre
@@ -1123,8 +1133,8 @@ public:
~CBotExprNum();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -1140,8 +1150,8 @@ public:
~CBotExprAlpha();
static
CBotInstr* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
};
@@ -1166,7 +1176,7 @@ public:
float GivValFloat();
CBotString GivValString();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void Add(CBotVar* left, CBotVar* right); // addition
@@ -1176,12 +1186,12 @@ public:
int Modulo(CBotVar* left, CBotVar* right); // reste de division
void Power(CBotVar* left, CBotVar* right); // puissance
- BOOL Lo(CBotVar* left, CBotVar* right);
- BOOL Hi(CBotVar* left, CBotVar* right);
- BOOL Ls(CBotVar* left, CBotVar* right);
- BOOL Hs(CBotVar* left, CBotVar* right);
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Lo(CBotVar* left, CBotVar* right);
+ bool Hi(CBotVar* left, CBotVar* right);
+ bool Ls(CBotVar* left, CBotVar* right);
+ bool Hs(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
void XOr(CBotVar* left, CBotVar* right);
void Or(CBotVar* left, CBotVar* right);
@@ -1196,8 +1206,8 @@ public:
void Inc();
void Dec();
- BOOL Save0State(FILE* pf);
- BOOL Save1State(FILE* pf);
+ bool Save0State(FILE* pf);
+ bool Save1State(FILE* pf);
};
@@ -1217,7 +1227,7 @@ public:
float GivValFloat();
CBotString GivValString();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void Add(CBotVar* left, CBotVar* right); // addition
@@ -1227,18 +1237,18 @@ public:
int Modulo(CBotVar* left, CBotVar* right); // reste de division
void Power(CBotVar* left, CBotVar* right); // puissance
- BOOL Lo(CBotVar* left, CBotVar* right);
- BOOL Hi(CBotVar* left, CBotVar* right);
- BOOL Ls(CBotVar* left, CBotVar* right);
- BOOL Hs(CBotVar* left, CBotVar* right);
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Lo(CBotVar* left, CBotVar* right);
+ bool Hi(CBotVar* left, CBotVar* right);
+ bool Ls(CBotVar* left, CBotVar* right);
+ bool Hs(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
void Neg();
void Inc();
void Dec();
- BOOL Save1State(FILE* pf);
+ bool Save1State(FILE* pf);
};
@@ -1255,25 +1265,25 @@ public:
void SetValString(const char* p);
CBotString GivValString();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void Add(CBotVar* left, CBotVar* right); // addition
- BOOL Lo(CBotVar* left, CBotVar* right);
- BOOL Hi(CBotVar* left, CBotVar* right);
- BOOL Ls(CBotVar* left, CBotVar* right);
- BOOL Hs(CBotVar* left, CBotVar* right);
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Lo(CBotVar* left, CBotVar* right);
+ bool Hi(CBotVar* left, CBotVar* right);
+ bool Ls(CBotVar* left, CBotVar* right);
+ bool Hs(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
- BOOL Save1State(FILE* pf);
+ bool Save1State(FILE* pf);
};
// classe pour la gestion des boolean
class CBotVarBoolean : public CBotVar
{
private:
- BOOL m_val; // la valeur
+ bool m_val; // la valeur
public:
CBotVarBoolean( const CBotToken* name );
@@ -1285,16 +1295,16 @@ public:
float GivValFloat();
CBotString GivValString();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void And(CBotVar* left, CBotVar* right);
void Or(CBotVar* left, CBotVar* right);
void XOr(CBotVar* left, CBotVar* right);
void Not();
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
- BOOL Save1State(FILE* pf);
+ bool Save1State(FILE* pf);
};
@@ -1315,7 +1325,7 @@ private:
friend class CBotVarPointer; // et le pointeur aussi
int m_CptUse; // compteur d'utilisation
long m_ItemIdent; // identificateur (unique) de l'instance
- BOOL m_bConstructor; // set si un constructeur a été appelé
+ bool m_bConstructor; // set si un constructeur a été appelé
public:
CBotVarClass( const CBotToken* name, const CBotTypResult& type );
@@ -1323,19 +1333,19 @@ public:
~CBotVarClass();
// void InitCBotVarClass( const CBotToken* name, CBotTypResult& type, int &nIdent );
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void SetClass(CBotClass* pClass); //, int &nIdent);
CBotClass* GivClass();
CBotVar* GivItem(const char* name); // rend un élément d'une classe selon son nom (*)
CBotVar* GivItemRef(int nIdent);
- CBotVar* GivItem(int n, BOOL bExtend);
+ CBotVar* GivItem(int n, bool bExtend);
CBotVar* GivItemList();
CBotString GivValString();
- BOOL Save1State(FILE* pf);
- void Maj(void* pUser, BOOL bContinue);
+ bool Save1State(FILE* pf);
+ void Maj(void* pUser, bool bContinue);
void IncrementUse(); // une référence en plus
void DecrementUse(); // une référence en moins
@@ -1351,8 +1361,8 @@ public:
// CBotVar* GivMyThis();
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
void ConstructorSet();
};
@@ -1371,7 +1381,7 @@ public:
CBotVarPointer( const CBotToken* name, CBotTypResult& type );
~CBotVarPointer();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
+ void Copy(CBotVar* pSrc, bool bName=true);
void SetClass(CBotClass* pClass);
CBotClass* GivClass();
CBotVar* GivItem(const char* name); // rend un élément d'une classe selon son nom (*)
@@ -1387,11 +1397,11 @@ public:
long GivIdent(); // donne le numéro d'identification associé
void ConstructorSet();
- BOOL Save1State(FILE* pf);
- void Maj(void* pUser, BOOL bContinue);
+ bool Save1State(FILE* pf);
+ void Maj(void* pUser, bool bContinue);
- BOOL Eq(CBotVar* left, CBotVar* right);
- BOOL Ne(CBotVar* left, CBotVar* right);
+ bool Eq(CBotVar* left, CBotVar* right);
+ bool Ne(CBotVar* left, CBotVar* right);
};
@@ -1415,37 +1425,37 @@ public:
CBotVarClass*
GivPointer();
- void Copy(CBotVar* pSrc, BOOL bName=TRUE);
- CBotVar* GivItem(int n, BOOL bGrow=FALSE); // rend un élément selon son index numérique
+ void Copy(CBotVar* pSrc, bool bName=true);
+ CBotVar* GivItem(int n, bool bGrow=false); // rend un élément selon son index numérique
// agrandi le tableau si nécessaire si bExtend
// CBotVar* GivItem(const char* name); // rend un élément selon son index litéral
CBotVar* GivItemList(); // donne le premier élément de la liste
CBotString GivValString(); // donne le contenu du tableau dans une chaîne
- BOOL Save1State(FILE* pf);
+ bool Save1State(FILE* pf);
};
extern CBotInstr* CompileParams(CBotToken* &p, CBotCStack* pStack, CBotVar** ppVars);
-extern BOOL TypeCompatible( CBotTypResult& type1, CBotTypResult& type2, int op = 0 );
-extern BOOL TypesCompatibles( const CBotTypResult& type1, const CBotTypResult& type2 );
+extern bool TypeCompatible( CBotTypResult& type1, CBotTypResult& type2, int op = 0 );
+extern bool TypesCompatibles( const CBotTypResult& type1, const CBotTypResult& type2 );
-extern BOOL WriteWord(FILE* pf, WORD w);
-extern BOOL ReadWord(FILE* pf, WORD& w);
-extern BOOL ReadLong(FILE* pf, long& w);
-extern BOOL WriteFloat(FILE* pf, float w);
-extern BOOL WriteLong(FILE* pf, long w);
-extern BOOL ReadFloat(FILE* pf, float& w);
-extern BOOL WriteString(FILE* pf, CBotString s);
-extern BOOL ReadString(FILE* pf, CBotString& s);
-extern BOOL WriteType(FILE* pf, CBotTypResult type);
-extern BOOL ReadType(FILE* pf, CBotTypResult& type);
+extern bool WriteWord(FILE* pf, unsigned short w);
+extern bool ReadWord(FILE* pf, unsigned short& w);
+extern bool ReadLong(FILE* pf, long& w);
+extern bool WriteFloat(FILE* pf, float w);
+extern bool WriteLong(FILE* pf, long w);
+extern bool ReadFloat(FILE* pf, float& w);
+extern bool WriteString(FILE* pf, CBotString s);
+extern bool ReadString(FILE* pf, CBotString& s);
+extern bool WriteType(FILE* pf, CBotTypResult type);
+extern bool ReadType(FILE* pf, CBotTypResult& type);
extern float GivNumFloat( const char* p );
-#if FALSE
+#if false
extern void DEBUG( const char* text, int val, CBotStack* pile );
#endif
@@ -1463,36 +1473,36 @@ private:
private:
CBotString m_name;
- BOOL (*m_rExec) (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser) ;
+ bool (*m_rExec) (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser) ;
CBotTypResult
(*m_rComp) (CBotVar* &pVar, void* pUser) ;
CBotCall* m_next;
public:
CBotCall(const char* name,
- BOOL rExec (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser),
+ bool rExec (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser),
CBotTypResult rCompile (CBotVar* &pVar, void* pUser));
~CBotCall();
static
- BOOL AddFunction(const char* name,
- BOOL rExec (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser),
+ bool AddFunction(const char* name,
+ bool rExec (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser),
CBotTypResult rCompile (CBotVar* &pVar, void* pUser));
static
CBotTypResult
CompileCall(CBotToken* &p, CBotVar** ppVars, CBotCStack* pStack, long& nIdent);
static
- BOOL CheckCall(const char* name);
+ bool CheckCall(const char* name);
// static
// int DoCall(CBotToken* &p, CBotVar** ppVars, CBotStack* pStack, CBotTypResult& rettype);
static
int DoCall(long& nIdent, CBotToken* token, CBotVar** ppVars, CBotStack* pStack, CBotTypResult& rettype);
#if STACKRUN
- BOOL Run(CBotStack* pStack);
+ bool Run(CBotStack* pStack);
static
- BOOL RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotStack* pStack);
+ bool RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotStack* pStack);
#endif
CBotString GivName();
@@ -1508,7 +1518,7 @@ class CBotCallMethode
{
private:
CBotString m_name;
- BOOL (*m_rExec) (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception);
+ bool (*m_rExec) (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception);
CBotTypResult
(*m_rComp) (CBotVar* pThis, CBotVar* &pVar);
CBotCallMethode* m_next;
@@ -1517,7 +1527,7 @@ private:
public:
CBotCallMethode(const char* name,
- BOOL rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception),
+ bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception),
CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar));
~CBotCallMethode();
@@ -1550,8 +1560,8 @@ public:
~CBotDefParam();
static
CBotDefParam* Compile(CBotToken* &p, CBotCStack* pStack);
- BOOL Execute(CBotVar** ppVars, CBotStack* &pj);
- void RestoreState(CBotStack* &pj, BOOL bMain);
+ bool Execute(CBotVar** ppVars, CBotStack* &pj);
+ void RestoreState(CBotStack* &pj, bool bMain);
void AddNext(CBotDefParam* p);
int GivType();
@@ -1575,7 +1585,7 @@ private:
friend class CBotCStack;
// long m_nThisIdent;
long m_nFuncIdent;
- BOOL m_bSynchro; // méthode synchronisée ?
+ bool m_bSynchro; // méthode synchronisée ?
private:
CBotDefParam* m_Param; // liste des paramètres
@@ -1584,8 +1594,8 @@ private:
CBotToken m_retToken; // si retourne un CBotTypClass
CBotTypResult m_retTyp; // type complet du résultat
- BOOL m_bPublic; // fonction publique
- BOOL m_bExtern; // fonction extern
+ bool m_bPublic; // fonction publique
+ bool m_bExtern; // fonction extern
CBotString m_MasterClass; // nom de la classe qu'on dérive
CBotProgram* m_pProg;
friend class CBotProgram;
@@ -1600,32 +1610,32 @@ public:
CBotFunction();
~CBotFunction();
static
- CBotFunction* Compile(CBotToken* &p, CBotCStack* pStack, CBotFunction* pFunc, BOOL bLocal = TRUE);
+ CBotFunction* Compile(CBotToken* &p, CBotCStack* pStack, CBotFunction* pFunc, bool bLocal = true);
static
CBotFunction* Compile1(CBotToken* &p, CBotCStack* pStack, CBotClass* pClass);
- BOOL Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance = NULL);
+ bool Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance = NULL);
void RestoreState(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance = NULL);
void AddNext(CBotFunction* p);
CBotTypResult CompileCall(const char* name, CBotVar** ppVars, long& nIdent);
- CBotFunction* FindLocalOrPublic(long& nIdent, const char* name, CBotVar** ppVars, CBotTypResult& TypeOrError, BOOL bPublic = TRUE);
+ CBotFunction* FindLocalOrPublic(long& nIdent, const char* name, CBotVar** ppVars, CBotTypResult& TypeOrError, bool bPublic = true);
int DoCall(long& nIdent, const char* name, CBotVar** ppVars, CBotStack* pStack, CBotToken* pToken);
void RestoreCall(long& nIdent, const char* name, CBotVar** ppVars, CBotStack* pStack);
int DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppVars, CBotStack* pStack, CBotToken* pToken, CBotClass* pClass);
void RestoreCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppVars, CBotStack* pStack, CBotClass* pClass);
- BOOL CheckParam(CBotDefParam* pParam);
+ bool CheckParam(CBotDefParam* pParam);
static
void AddPublic(CBotFunction* pfunc);
CBotString GivName();
CBotString GivParams();
- BOOL IsPublic();
- BOOL IsExtern();
+ bool IsPublic();
+ bool IsExtern();
CBotFunction* Next();
- BOOL GetPosition(int& start, int& stop, CBotGet modestart, CBotGet modestop);
+ bool GetPosition(int& start, int& stop, CBotGet modestart, CBotGet modestop);
};