summaryrefslogtreecommitdiffstats
path: root/src/CBot/CBotWhile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CBot/CBotWhile.cpp')
-rw-r--r--src/CBot/CBotWhile.cpp216
1 files changed, 108 insertions, 108 deletions
diff --git a/src/CBot/CBotWhile.cpp b/src/CBot/CBotWhile.cpp
index 124fb3d..fcb825c 100644
--- a/src/CBot/CBotWhile.cpp
+++ b/src/CBot/CBotWhile.cpp
@@ -66,7 +66,7 @@ CBotInstr* CBotWhile::Compile(CBotToken* &p, CBotCStack* pStack)
// la condition existe
IncLvl(inst->m_label);
- inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, TRUE );
+ inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, true );
DecLvl();
if ( pStk->IsOk() )
@@ -83,31 +83,31 @@ CBotInstr* CBotWhile::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute une instruction "while"
-BOOL CBotWhile :: Execute(CBotStack* &pj)
+bool CBotWhile :: Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this); // ajoute un élément à la pile
// ou le retrouve en cas de reprise
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
- while( TRUE ) switch( pile->GivState() ) // exécute la boucle
+ while( true ) switch( pile->GivState() ) // exécute la boucle
{ // il y a 2 états possibles (selon reprise)
case 0:
// évalue la condition
- if ( !m_Condition->Execute(pile) ) return FALSE; // interrompu ici ?
+ if ( !m_Condition->Execute(pile) ) return false; // interrompu ici ?
// le résultat de la condition est sur la pile
// termine s'il y a une erreur ou si la condition est fausse
- if ( !pile->IsOk() || pile->GivVal() != TRUE )
+ if ( !pile->IsOk() || pile->GivVal() != true )
{
return pj->Return(pile); // transmet le résultat et libère la pile
}
// la condition est vrai, passe dans le second mode
- if (!pile->SetState(1)) return FALSE; // prêt pour la suite
+ if (!pile->SetState(1)) return false; // prêt pour la suite
case 1:
// évalue le bloc d'instruction associé
@@ -125,12 +125,12 @@ BOOL CBotWhile :: Execute(CBotStack* &pj)
}
// repasse au test pour recommencer
- if (!pile->SetState(0, 0)) return FALSE;
+ if (!pile->SetState(0, 0)) return false;
continue;
}
}
-void CBotWhile :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotWhile :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
CBotStack* pile = pj->RestoreStack(this); // ajoute un élément à la pile
@@ -196,7 +196,7 @@ CBotInstr* CBotRepeat::Compile(CBotToken* &p, CBotCStack* pStack)
{
IncLvl(inst->m_label);
- inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, TRUE );
+ inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, true );
DecLvl();
if ( pStk->IsOk() )
@@ -221,19 +221,19 @@ CBotInstr* CBotRepeat::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute une instruction "repeat"
-BOOL CBotRepeat :: Execute(CBotStack* &pj)
+bool CBotRepeat :: Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this); // ajoute un élément à la pile
// ou le retrouve en cas de reprise
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
- while( TRUE ) switch( pile->GivState() ) // exécute la boucle
+ while( true ) switch( pile->GivState() ) // exécute la boucle
{ // il y a 2 états possibles (selon reprise)
case 0:
// évalue le nombre d'itération
- if ( !m_NbIter->Execute(pile) ) return FALSE; // interrompu ici ?
+ if ( !m_NbIter->Execute(pile) ) return false; // interrompu ici ?
// le résultat de la condition est sur la pile
@@ -246,7 +246,7 @@ BOOL CBotRepeat :: Execute(CBotStack* &pj)
// met le nombre d'itération +1 dans le "state"
- if (!pile->SetState(n+1)) return FALSE; // prêt pour la suite
+ if (!pile->SetState(n+1)) return false; // prêt pour la suite
continue; // passe à la suite
case 1:
@@ -269,12 +269,12 @@ BOOL CBotRepeat :: Execute(CBotStack* &pj)
}
// repasse au test pour recommencer
- if (!pile->SetState(pile->GivState()-1, 0)) return FALSE;
+ if (!pile->SetState(pile->GivState()-1, 0)) return false;
continue;
}
}
-void CBotRepeat :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotRepeat :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
CBotStack* pile = pj->RestoreStack(this); // ajoute un élément à la pile
@@ -332,7 +332,7 @@ CBotInstr* CBotDo::Compile(CBotToken* &p, CBotCStack* pStack)
// cherche un bloc d'instruction après le do
IncLvl(inst->m_label);
- inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, TRUE );
+ inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, true );
DecLvl();
if ( pStk->IsOk() )
@@ -358,15 +358,15 @@ CBotInstr* CBotDo::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute une instruction "do"
-BOOL CBotDo :: Execute(CBotStack* &pj)
+bool CBotDo :: Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this); // ajoute un élément à la pile
// ou le retrouve en cas de reprise
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
- while( TRUE ) switch( pile->GivState() ) // exécute la boucle
+ while( true ) switch( pile->GivState() ) // exécute la boucle
{ // il y a 2 états possibles (selon reprise)
case 0:
// évalue le bloc d'instruction associé
@@ -383,27 +383,27 @@ BOOL CBotDo :: Execute(CBotStack* &pj)
return pj->Return(pile); // transmet le résultat et libère la pile
}
- if (!pile->SetState(1)) return FALSE; // prêt pour la suite
+ if (!pile->SetState(1)) return false; // prêt pour la suite
case 1:
// évalue la condition
- if ( !m_Condition->Execute(pile) ) return FALSE; // interrompu ici ?
+ if ( !m_Condition->Execute(pile) ) return false; // interrompu ici ?
// le résultat de la condition est sur la pile
// termine s'il y a une erreur ou si la condition est fausse
- if ( !pile->IsOk() || pile->GivVal() != TRUE )
+ if ( !pile->IsOk() || pile->GivVal() != true )
{
return pj->Return(pile); // transmet le résultat et libère la pile
}
// repasse au bloc d'instruction pour recommencer
- if (!pile->SetState(0, 0)) return FALSE;
+ if (!pile->SetState(0, 0)) return false;
continue;
}
}
-void CBotDo :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotDo :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
@@ -467,7 +467,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
return NULL;
}
- CBotCStack* pStk = pStack->TokenStack(pp, TRUE); // un petit bout de pile svp
+ CBotCStack* pStk = pStack->TokenStack(pp, true); // un petit bout de pile svp
// compile les instructions pour initialisation
inst->m_Init = CBotListExpression::Compile( p, pStk );
@@ -494,7 +494,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
if ( IsOfType(p, ID_CLOSEPAR)) // manque la parenthèse ?
{
IncLvl(inst->m_label);
- inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, TRUE );
+ inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk, true );
DecLvl();
if ( pStk->IsOk() )
return pStack->Return(inst, pStk);;
@@ -510,39 +510,39 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute l'instruction "for"
-BOOL CBotFor :: Execute(CBotStack* &pj)
+bool CBotFor :: Execute(CBotStack* &pj)
{
- CBotStack* pile = pj->AddStack(this, TRUE); // ajoute un élément à la pile (variables locales)
+ CBotStack* pile = pj->AddStack(this, true); // ajoute un élément à la pile (variables locales)
// ou le retrouve en cas de reprise
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
- while( TRUE ) switch( pile->GivState() ) // exécute la boucle
+ while( true ) switch( pile->GivState() ) // exécute la boucle
{ // il y a 4 états possibles (selon reprise)
case 0:
// évalue l'initialisation
if ( m_Init != NULL &&
- !m_Init->Execute(pile) ) return FALSE; // interrompu ici ?
- if (!pile->SetState(1)) return FALSE; // prêt pour la suite
+ !m_Init->Execute(pile) ) return false; // interrompu ici ?
+ if (!pile->SetState(1)) return false; // prêt pour la suite
case 1:
// évalue la condition
if ( m_Test != NULL ) // pas de condition ? -> vrai !
{
- if (!m_Test->Execute(pile) ) return FALSE; // interrompu ici ?
+ if (!m_Test->Execute(pile) ) return false; // interrompu ici ?
// le résultat de la condition est sur la pile
// termine s'il y a une erreur ou si la condition est fausse
- if ( !pile->IsOk() || pile->GivVal() != TRUE )
+ if ( !pile->IsOk() || pile->GivVal() != true )
{
return pj->Return(pile); // transmet le résultat et libère la pile
}
}
// la condition est vrai, passe à la suite
- if (!pile->SetState(2)) return FALSE; // prêt pour la suite
+ if (!pile->SetState(2)) return false; // prêt pour la suite
case 2:
// évalue le bloc d'instruction associé
@@ -559,20 +559,20 @@ BOOL CBotFor :: Execute(CBotStack* &pj)
return pj->Return(pile); // transmet le résultat et libère la pile
}
- if (!pile->SetState(3)) return FALSE; // prêt pour la suite
+ if (!pile->SetState(3)) return false; // prêt pour la suite
case 3:
// évalue l'incrémentation
if ( m_Incr != NULL &&
- !m_Incr->Execute(pile) ) return FALSE; // interrompu ici ?
+ !m_Incr->Execute(pile) ) return false; // interrompu ici ?
// repasse au test pour recommencer
- if (!pile->SetState(1, 0)) return FALSE; // revient au test
+ if (!pile->SetState(1, 0)) return false; // revient au test
continue;
}
}
-void CBotFor :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotFor :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
@@ -583,28 +583,28 @@ void CBotFor :: RestoreState(CBotStack* &pj, BOOL bMain)
{ // il y a 4 états possibles (selon reprise)
case 0:
// évalue l'initialisation
- if ( m_Init != NULL ) m_Init->RestoreState(pile, TRUE); // interrompu ici !
+ if ( m_Init != NULL ) m_Init->RestoreState(pile, true); // interrompu ici !
return;
case 1:
- if ( m_Init != NULL ) m_Init->RestoreState(pile, FALSE); // définitions variables
+ if ( m_Init != NULL ) m_Init->RestoreState(pile, false); // définitions variables
// évalue la condition
- if ( m_Test != NULL ) m_Test->RestoreState(pile, TRUE); // interrompu ici !
+ if ( m_Test != NULL ) m_Test->RestoreState(pile, true); // interrompu ici !
return;
case 2:
- if ( m_Init != NULL ) m_Init->RestoreState(pile, FALSE); // définitions variables
+ if ( m_Init != NULL ) m_Init->RestoreState(pile, false); // définitions variables
// évalue le bloc d'instruction associé
- if ( m_Block != NULL ) m_Block->RestoreState(pile, TRUE);
+ if ( m_Block != NULL ) m_Block->RestoreState(pile, true);
return;
case 3:
- if ( m_Init != NULL ) m_Init->RestoreState(pile, FALSE); // définitions variables
+ if ( m_Init != NULL ) m_Init->RestoreState(pile, false); // définitions variables
// évalue l'incrémentation
- if ( m_Incr != NULL ) m_Incr->RestoreState(pile, TRUE); // interrompu ici !
+ if ( m_Incr != NULL ) m_Incr->RestoreState(pile, true); // interrompu ici !
return;
}
}
@@ -629,10 +629,10 @@ CBotListExpression::~CBotListExpression()
static CBotInstr* CompileInstrOrDefVar(CBotToken* &p, CBotCStack* pStack)
{
- CBotInstr* i = CBotInt::Compile( p, pStack, FALSE, TRUE ); // est-ce une déclaration d'un entier ?
- if ( i== NULL ) i = CBotFloat::Compile( p, pStack, FALSE, TRUE ); // ou d'un nombre réel ?
- if ( i== NULL ) i = CBotBoolean::Compile( p, pStack, FALSE, TRUE ); // ou d'un booléen ?
- if ( i== NULL ) i = CBotIString::Compile( p, pStack, FALSE, TRUE ); // ou d'une chaîne ?
+ CBotInstr* i = CBotInt::Compile( p, pStack, false, true ); // est-ce une déclaration d'un entier ?
+ if ( i== NULL ) i = CBotFloat::Compile( p, pStack, false, true ); // ou d'un nombre réel ?
+ if ( i== NULL ) i = CBotBoolean::Compile( p, pStack, false, true ); // ou d'un booléen ?
+ if ( i== NULL ) i = CBotIString::Compile( p, pStack, false, true ); // ou d'une chaîne ?
if ( i== NULL ) i = CBotExpression::Compile( p, pStack ); // compile une expression
return i;
}
@@ -660,7 +660,7 @@ CBotInstr* CBotListExpression::Compile(CBotToken* &p, CBotCStack* pStack)
return NULL;
}
-BOOL CBotListExpression::Execute(CBotStack* &pj)
+bool CBotListExpression::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack();// indispensable
CBotInstr* p = m_Expr; // la première expression
@@ -668,17 +668,17 @@ BOOL CBotListExpression::Execute(CBotStack* &pj)
int state = pile->GivState();
while (state-->0) p = p->GivNext(); // revient sur l'opération interrompue
- if ( p != NULL ) while (TRUE)
+ if ( p != NULL ) while (true)
{
- if ( !p->Execute(pile) ) return FALSE;
+ if ( !p->Execute(pile) ) return false;
p = p->GivNext();
if ( p == NULL ) break;
- if (!pile->IncState()) return FALSE; // prêt pour la suivante
+ if (!pile->IncState()) return false; // prêt pour la suivante
}
return pj->Return(pile);
}
-void CBotListExpression::RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotListExpression::RestoreState(CBotStack* &pj, bool bMain)
{
CBotStack* pile = pj;
int state = 0x7000;
@@ -694,7 +694,7 @@ void CBotListExpression::RestoreState(CBotStack* &pj, BOOL bMain)
while (p != NULL && state-->0)
{
- p->RestoreState(pile, FALSE);
+ p->RestoreState(pile, false);
p = p->GivNext(); // revient sur l'opération interrompue
}
@@ -770,7 +770,7 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
return pStack->Return(NULL, pStk);
}
- CBotInstr* i = CBotBlock::CompileBlkOrInst( p, pStk, TRUE );
+ CBotInstr* i = CBotBlock::CompileBlkOrInst( p, pStk, true );
if ( !pStk->IsOk() )
{
delete inst;
@@ -811,21 +811,21 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute une instruction "switch"
-BOOL CBotSwitch :: Execute(CBotStack* &pj)
+bool CBotSwitch :: Execute(CBotStack* &pj)
{
CBotStack* pile1 = pj->AddStack(this); // ajoute un élément à la pile
-// if ( pile1 == EOX ) return TRUE;
+// if ( pile1 == EOX ) return true;
CBotInstr* p = m_Block; // la première expression
int state = pile1->GivState();
if (state == 0)
{
- if ( !m_Value->Execute(pile1) ) return FALSE;
+ if ( !m_Value->Execute(pile1) ) return false;
pile1->SetState(state = -1);
}
- if ( pile1->IfStep() ) return FALSE;
+ if ( pile1->IfStep() ) return false;
if ( state == -1 )
{
@@ -843,7 +843,7 @@ BOOL CBotSwitch :: Execute(CBotStack* &pj)
if ( p == NULL ) return pj->Return(pile1); // terminé si plus rien
- if ( !pile1->SetState(state) ) return FALSE;
+ if ( !pile1->SetState(state) ) return false;
}
p = m_Block; // revient au début
@@ -852,13 +852,13 @@ BOOL CBotSwitch :: Execute(CBotStack* &pj)
while( p != NULL )
{
if ( !p->Execute(pile1) ) return pj->BreakReturn(pile1);
- if ( !pile1->IncState() ) return FALSE;
+ if ( !pile1->IncState() ) return false;
p = p->GivNext();
}
return pj->Return(pile1);
}
-void CBotSwitch :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotSwitch :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
@@ -882,13 +882,13 @@ void CBotSwitch :: RestoreState(CBotStack* &pj, BOOL bMain)
// p = m_Block; // revient au début
while ( p != NULL && state-- > 0 )
{
- p->RestoreState(pile1, FALSE);
+ p->RestoreState(pile1, false);
p = p->GivNext(); // avance dans la liste
}
if( p != NULL )
{
- p->RestoreState(pile1, TRUE);
+ p->RestoreState(pile1, true);
return;
}
}
@@ -942,21 +942,21 @@ CBotInstr* CBotCase::Compile(CBotToken* &p, CBotCStack* pStack)
// exécution de l'instruction "case"
-BOOL CBotCase::Execute(CBotStack* &pj)
+bool CBotCase::Execute(CBotStack* &pj)
{
- return TRUE; // l'instruction "case" ne fait rien !
+ return true; // l'instruction "case" ne fait rien !
}
-void CBotCase::RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotCase::RestoreState(CBotStack* &pj, bool bMain)
{
}
// routine permettant de trouver le point d'entrée "case"
// correspondant à la valeur cherchée
-BOOL CBotCase::CompCase(CBotStack* &pile, int val)
+bool CBotCase::CompCase(CBotStack* &pile, int val)
{
- if ( m_Value == NULL ) return TRUE; // cas pour "default"
+ if ( m_Value == NULL ) return true; // cas pour "default"
while (!m_Value->Execute(pile)); // met sur la pile la valeur correpondant (sans interruption)
return (pile->GivVal() == val); // compare avec la valeur cherchée
@@ -1016,18 +1016,18 @@ CBotInstr* CBotBreak::Compile(CBotToken* &p, CBotCStack* pStack)
// exécution l'instructino "break" ou "continu"
-BOOL CBotBreak :: Execute(CBotStack* &pj)
+bool CBotBreak :: Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
pile->SetBreak(m_token.GivType()==ID_BREAK ? 1 : 2, m_label);
return pj->Return(pile);
}
-void CBotBreak :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotBreak :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( bMain ) pj->RestoreStack(this);
}
@@ -1092,14 +1092,14 @@ CBotInstr* CBotTry::Compile(CBotToken* &p, CBotCStack* pStack)
// les arrêts par suspension
// et les "finaly"
-BOOL CBotTry :: Execute(CBotStack* &pj)
+bool CBotTry :: Execute(CBotStack* &pj)
{
int val;
CBotStack* pile1 = pj->AddStack(this); // ajoute un élément à la pile
-// if ( pile1 == EOX ) return TRUE;
+// if ( pile1 == EOX ) return true;
- if ( pile1->IfStep() ) return FALSE;
+ if ( pile1->IfStep() ) return false;
// ou le retrouve en cas de reprise
CBotStack* pile0 = pj->AddStack2(); // ajoute un élément à la pile secondaire
CBotStack* pile2 = pile0->AddStack();
@@ -1114,14 +1114,14 @@ BOOL CBotTry :: Execute(CBotStack* &pj)
val = pile1->GivError();
if ( val == 0 && CBotStack::m_initimer == 0 ) // en mode de step ?
- return FALSE; // ne fait pas le catch
+ return false; // ne fait pas le catch
pile1->IncState();
pile2->SetState(val); // mémorise le numéro de l'erreur
pile1->SetError(0); // pour l'instant il n'y a plus d'erreur !
if ( val == 0 && CBotStack::m_initimer < 0 ) // en mode de step ?
- return FALSE; // ne fait pas le catch
+ return false; // ne fait pas le catch
}
// il y a eu une interruption
@@ -1137,16 +1137,16 @@ BOOL CBotTry :: Execute(CBotStack* &pj)
if ( --state <= 0 )
{
// demande au bloc catch s'il se sent concerné
- if ( !pc->TestCatch(pile2, val) ) return FALSE; // suspendu !
+ if ( !pc->TestCatch(pile2, val) ) return false; // suspendu !
pile1->IncState();
}
if ( --state <= 0 )
{
- if ( pile2->GivVal() == TRUE )
+ if ( pile2->GivVal() == true )
{
// pile0->SetState(1);
- if ( !pc->Execute(pile2) ) return FALSE; // exécute l'opération
+ if ( !pc->Execute(pile2) ) return false; // exécute l'opération
if ( m_FinalInst == NULL )
return pj->Return(pile2); // termine le try
@@ -1164,7 +1164,7 @@ BOOL CBotTry :: Execute(CBotStack* &pj)
{
// pile0->SetState(1);
- if (!m_FinalInst->Execute(pile2) && pile2->IsOk()) return FALSE;
+ if (!m_FinalInst->Execute(pile2) && pile2->IsOk()) return false;
if (!pile2->IsOk()) return pj->Return(pile2); // garde cette exception
pile2->SetError(pile1->GivState()==-1 ? val : 0); // remet l'erreur initiale
return pj->Return(pile2);
@@ -1176,11 +1176,11 @@ BOOL CBotTry :: Execute(CBotStack* &pj)
return pj->Return(pile2); // termine le try sans exception aucune
pile1->SetError(val); // remet l'erreur
- return FALSE; // ce n'est pas pour nous
+ return false; // ce n'est pas pour nous
}
-void CBotTry :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotTry :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
@@ -1217,7 +1217,7 @@ void CBotTry :: RestoreState(CBotStack* &pj, BOOL bMain)
}
if ( --state <= 0 )
{
- if ( pile2->GivVal() == TRUE )
+ if ( pile2->GivVal() == true )
{
pc->RestoreState(pile2, bMain); // exécute l'opération
return;
@@ -1285,27 +1285,27 @@ CBotCatch* CBotCatch::Compile(CBotToken* &p, CBotCStack* pStack)
// exécution de "catch"
-BOOL CBotCatch :: Execute(CBotStack* &pj)
+bool CBotCatch :: Execute(CBotStack* &pj)
{
- if ( m_Block == NULL ) return TRUE;
+ if ( m_Block == NULL ) return true;
return m_Block->Execute(pj); // exécute le bloc associé
}
-void CBotCatch :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotCatch :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( bMain && m_Block != NULL ) m_Block->RestoreState(pj, bMain);
}
-void CBotCatch :: RestoreCondState(CBotStack* &pj, BOOL bMain)
+void CBotCatch :: RestoreCondState(CBotStack* &pj, bool bMain)
{
m_Cond->RestoreState(pj, bMain);
}
// routine pour savoir si le catch est à faire ou non
-BOOL CBotCatch :: TestCatch(CBotStack* &pile, int val)
+bool CBotCatch :: TestCatch(CBotStack* &pile, int val)
{
- if ( !m_Cond->Execute(pile) ) return FALSE;
+ if ( !m_Cond->Execute(pile) ) return false;
if ( val > 0 || pile->GivType() != CBotTypBoolean )
{
@@ -1314,7 +1314,7 @@ BOOL CBotCatch :: TestCatch(CBotStack* &pile, int val)
pile->SetVar(var); // remet sur la pile
}
- return TRUE;
+ return true;
}
///////////////////////////////////////////////////////////////////////////
@@ -1359,18 +1359,18 @@ CBotInstr* CBotThrow::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute l'instruction "throw"
-BOOL CBotThrow :: Execute(CBotStack* &pj)
+bool CBotThrow :: Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
-// if ( pile == EOX ) return TRUE;
+// if ( pile == EOX ) return true;
if ( pile->GivState() == 0 )
{
- if ( !m_Value->Execute(pile) ) return FALSE;
+ if ( !m_Value->Execute(pile) ) return false;
pile->IncState();
}
- if ( pile->IfStep() ) return FALSE;
+ if ( pile->IfStep() ) return false;
int val = pile->GivVal();
if ( val < 0 ) val = TX_BADTHROW;
@@ -1378,7 +1378,7 @@ BOOL CBotThrow :: Execute(CBotStack* &pj)
return pj->Return( pile );
}
-void CBotThrow :: RestoreState(CBotStack* &pj, BOOL bMain)
+void CBotThrow :: RestoreState(CBotStack* &pj, bool bMain)
{
if ( !bMain ) return;
@@ -1417,11 +1417,11 @@ CBotInstr* CBotStartDebugDD::Compile(CBotToken* &p, CBotCStack* pStack)
// exécute l'instruction "throw"
-BOOL CBotStartDebugDD :: Execute(CBotStack* &pj)
+bool CBotStartDebugDD :: Execute(CBotStack* &pj)
{
CBotProgram* p = pj->GivBotCall();
- p->m_bDebugDD = TRUE;
+ p->m_bDebugDD = true;
- return TRUE;
+ return true;
}