summaryrefslogtreecommitdiffstats
path: root/src/CBot
diff options
context:
space:
mode:
authorMichał Konopacki <konopacki.m@gmail.com>2012-08-11 20:59:35 +0200
committerMichał Konopacki <konopacki.m@gmail.com>2012-08-11 20:59:35 +0200
commita9186d19609c61c369d881cdbc40cc8973cf883d (patch)
treef55d4b999b036702780f0aa8b91ddeb1fb23d186 /src/CBot
parent7b03a6a2acb9c7ddbae663b27be4b223f984cfcd (diff)
downloadcolobot-a9186d19609c61c369d881cdbc40cc8973cf883d.tar.gz
colobot-a9186d19609c61c369d881cdbc40cc8973cf883d.tar.bz2
colobot-a9186d19609c61c369d881cdbc40cc8973cf883d.zip
Changed GivAttrName() to GetAttrName()
Diffstat (limited to 'src/CBot')
-rw-r--r--src/CBot/CBot.cpp638
-rw-r--r--src/CBot/CBot.h144
-rw-r--r--src/CBot/CBotClass.cpp126
-rw-r--r--src/CBot/CBotDll.h126
-rw-r--r--src/CBot/CBotFunction.cpp268
-rw-r--r--src/CBot/CBotIf.cpp8
-rw-r--r--src/CBot/CBotProgram.cpp102
-rw-r--r--src/CBot/CBotStack.cpp152
-rw-r--r--src/CBot/CBotString.cpp18
-rw-r--r--src/CBot/CBotToken.cpp54
-rw-r--r--src/CBot/CBotTwoOpExpr.cpp78
-rw-r--r--src/CBot/CBotVar.cpp406
-rw-r--r--src/CBot/CBotWhile.cpp168
-rw-r--r--src/CBot/ClassFILE.cpp92
-rw-r--r--src/CBot/StringFunctions.cpp126
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotConsole.cpp14
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotDoc.cpp10
-rw-r--r--src/CBot/tests/CBot_console/src/app/CClass.cpp16
-rw-r--r--src/CBot/tests/CBot_console/src/app/routines.cpp36
19 files changed, 1291 insertions, 1291 deletions
diff --git a/src/CBot/CBot.cpp b/src/CBot/CBot.cpp
index 62d9fb7..13da729 100644
--- a/src/CBot/CBot.cpp
+++ b/src/CBot/CBot.cpp
@@ -112,14 +112,14 @@ void CBotInstr::SetToken(CBotToken* p)
// return the type of the token assicated with the instruction
-int CBotInstr::GivTokenType()
+int CBotInstr::GetTokenType()
{
- return m_token.GivType();
+ return m_token.GetType();
}
// return associated token
-CBotToken* CBotInstr::GivToken()
+CBotToken* CBotInstr::GetToken()
{
return &m_token;
}
@@ -149,17 +149,17 @@ void CBotInstr::AddNext3b(CBotInstr* n)
// returns next statement
-CBotInstr* CBotInstr::GivNext()
+CBotInstr* CBotInstr::GetNext()
{
return m_next;
}
-CBotInstr* CBotInstr::GivNext3()
+CBotInstr* CBotInstr::GetNext3()
{
return m_next3;
}
-CBotInstr* CBotInstr::GivNext3b()
+CBotInstr* CBotInstr::GetNext3b()
{
return m_next3b;
}
@@ -178,17 +178,17 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
if (p == NULL) return NULL;
- int type = p->GivType(); // what is the next token
+ int type = p->GetType(); // what is the next token
// is it a lable?
if (IsOfType(pp, TokenTypVar) &&
IsOfType(pp, ID_DOTS))
{
- type = pp->GivType();
+ type = pp->GetType();
// these instructions accept only lable
if (!IsOfTypeList(pp, ID_WHILE, ID_FOR, ID_DO, ID_REPEAT, 0))
{
- pStack->SetError(TX_LABEL, pp->GivStart());
+ pStack->SetError(TX_LABEL, pp->GetStart());
return NULL;
}
}
@@ -244,20 +244,20 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
return CBotReturn::Compile(p, pStack);
case ID_ELSE:
- pStack->SetStartError(p->GivStart());
- pStack->SetError(TX_ELSEWITHOUTIF, p->GivEnd());
+ pStack->SetStartError(p->GetStart());
+ pStack->SetError(TX_ELSEWITHOUTIF, p->GetEnd());
return NULL;
case ID_CASE:
- pStack->SetStartError(p->GivStart());
- pStack->SetError(TX_OUTCASE, p->GivEnd());
+ pStack->SetStartError(p->GetStart());
+ pStack->SetError(TX_OUTCASE, p->GetEnd());
return NULL;
}
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
// should not be a reserved word DefineNum
- if (p->GivType() == TokenTypDef)
+ if (p->GetType() == TokenTypDef)
{
pStack->SetError(TX_RESERVED, p);
return NULL;
@@ -280,7 +280,7 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
{
return inst;
}
- pStack->SetError(TX_ENDOF, p->GivStart());
+ pStack->SetError(TX_ENDOF, p->GetStart());
delete inst;
return NULL;
}
@@ -296,7 +296,7 @@ bool CBotInstr::Execute(CBotStack* &pj)
bool CBotInstr::Execute(CBotStack* &pj, CBotVar* pVar)
{
if (!Execute(pj)) return false;
- pVar->SetVal(pj->GivVar());
+ pVar->SetVal(pj->GetVar());
return true;
}
@@ -347,7 +347,7 @@ bool CBotInstr::CompCase(CBotStack* &pj, int val)
CBotInstr* CBotBlock::Compile(CBotToken* &p, CBotCStack* pStack, bool bLocal)
{
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
if (IsOfType(p, ID_OPBLK))
{
@@ -358,19 +358,19 @@ CBotInstr* CBotBlock::Compile(CBotToken* &p, CBotCStack* pStack, bool bLocal)
return inst;
}
- pStack->SetError(TX_CLOSEBLK, p->GivStart()); // missing parenthesis
+ pStack->SetError(TX_CLOSEBLK, p->GetStart()); // missing parenthesis
delete inst;
return NULL;
}
- pStack->SetError(TX_OPENBLK, p->GivStart());
+ pStack->SetError(TX_OPENBLK, p->GetStart());
return NULL;
}
CBotInstr* CBotBlock::CompileBlkOrInst(CBotToken* &p, CBotCStack* pStack, bool bLocal)
{
// is this a new block
- if (p->GivType() == ID_OPBLK) return CBotBlock::Compile(p, pStack);
+ if (p->GetType() == ID_OPBLK) return CBotBlock::Compile(p, pStack);
// otherwise, look for a single statement instead
@@ -414,11 +414,11 @@ CBotInstr* CBotListInstr::Compile(CBotToken* &p, CBotCStack* pStack, bool bLocal
if (p == NULL) break;
if (IsOfType(p, ID_SEP)) continue; // empty statement ignored
- if (p->GivType() == ID_CLBLK) break;
+ if (p->GetType() == ID_CLBLK) break;
if (IsOfType(p, 0))
{
- pStack->SetError(TX_CLOSEBLK, p->GivStart());
+ pStack->SetError(TX_CLOSEBLK, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk);
}
@@ -448,13 +448,13 @@ bool CBotListInstr::Execute(CBotStack* &pj)
CBotInstr* p = m_Instr; // the first expression
- int state = pile->GivState();
- while (state-->0) p = p->GivNext(); // returns to the interrupted operation
+ int state = pile->GetState();
+ while (state-->0) p = p->GetNext(); // returns to the interrupted operation
if (p != NULL) while (true)
{
if (!p->Execute(pile)) return false;
- p = p->GivNext();
+ p = p->GetNext();
if (p == NULL) break;
if (!pile->IncState()) ;//return false; // ready for next
}
@@ -471,11 +471,11 @@ void CBotListInstr::RestoreState(CBotStack* &pj, bool bMain)
CBotInstr* p = m_Instr; // the first expression
- int state = pile->GivState();
+ int state = pile->GetState();
while ( p != NULL && state-- > 0)
{
p->RestoreState(pile, false);
- p = p->GivNext(); // returns to the interrupted operation
+ p = p->GetNext(); // returns to the interrupted operation
}
if (p != NULL) p->RestoreState(pile, true);
@@ -500,15 +500,15 @@ CBotLeftExprVar::~CBotLeftExprVar()
CBotInstr* CBotLeftExprVar::Compile(CBotToken* &p, CBotCStack* pStack)
{
// verifies that the token is a variable name
- if (p->GivType() != TokenTypVar)
+ if (p->GetType() != TokenTypVar)
{
- pStack->SetError( TX_NOVAR, p->GivStart());
+ pStack->SetError( TX_NOVAR, p->GetStart());
return NULL;
}
CBotLeftExprVar* inst = new CBotLeftExprVar();
inst->SetToken(p);
- p = p->GivNext();
+ p = p->GetNext();
return inst;
}
@@ -519,11 +519,11 @@ bool CBotLeftExprVar::Execute(CBotStack* &pj)
CBotVar* var1;
CBotVar* var2;
- var1 = CBotVar::Create(m_token.GivString(), m_typevar);
+ var1 = CBotVar::Create(m_token.GetString(), m_typevar);
var1->SetUniqNum(m_nIdent); // with the unique identifier
pj->AddVar(var1); // place it on the stack
- var2 = pj->GivVar(); // result on the stack
+ var2 = pj->GetVar(); // result on the stack
if (var2) var1->SetVal(var2); // do the assignment
return true;
@@ -533,7 +533,7 @@ void CBotLeftExprVar::RestoreState(CBotStack* &pj, bool bMain)
{
CBotVar* var1;
- var1 = pj->FindVar(m_token.GivString());
+ var1 = pj->FindVar(m_token.GetString());
if (var1 == NULL) ASM_TRAP();
var1->SetUniqNum(m_nIdent); // with the unique identifier
@@ -583,7 +583,7 @@ CBotInstr* CBotInstArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
CBotInstr* i;
while (IsOfType(p, ID_OPBRK))
{
- if (p->GivType() != ID_CLBRK)
+ if (p->GetType() != ID_CLBRK)
i = CBotExpression::Compile(p, pStk); // expression for the value
else
i = new CBotEmpty(); // if no special formula
@@ -593,7 +593,7 @@ CBotInstr* CBotInstArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
if (!pStk->IsOk() || !IsOfType(p, ID_CLBRK ))
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto error;
}
}
@@ -607,7 +607,7 @@ CBotInstr* CBotInstArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
if (IsOfType(p, ID_ASS)) // with an assignment
{
- inst->m_listass = CBotListArray::Compile(p, pStk, type.GivTypElem());
+ inst->m_listass = CBotListArray::Compile(p, pStk, type.GetTypElem());
}
if (pStk->IsOk()) return pStack->Return(inst, pStk);
@@ -627,25 +627,25 @@ bool CBotInstArray::Execute(CBotStack* &pj)
CBotStack* pile = pile1;
- if (pile1->GivState() == 0)
+ if (pile1->GetState() == 0)
{
// seek the maximum dimension of the table
- CBotInstr* p = GivNext3b(); // the different formulas
+ CBotInstr* p = GetNext3b(); // the different formulas
int nb = 0;
while (p != NULL)
{
pile = pile->AddStack(); // little room to work
nb++;
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
if (!p->Execute(pile)) return false; // size calculation //interrupted?
pile->IncState();
}
- p = p->GivNext3b();
+ p = p->GetNext3b();
}
- p = GivNext3b();
+ p = GetNext3b();
pile = pile1; // returns to the stack
int n = 0;
int max[100];
@@ -653,22 +653,22 @@ bool CBotInstArray::Execute(CBotStack* &pj)
while (p != NULL)
{
pile = pile->AddStack();
- CBotVar* v = pile->GivVar(); // result
- max[n] = v->GivValInt(); // value
+ CBotVar* v = pile->GetVar(); // result
+ max[n] = v->GetValInt(); // value
if (max[n]>MAXARRAYSIZE)
{
pile->SetError(TX_OUTARRAY, &m_token);
return pj->Return (pile);
}
n++;
- p = p->GivNext3b();
+ p = p->GetNext3b();
}
while (n<100) max[n++] = 0;
m_typevar.SetArray(max); // store the limitations
// create simply a NULL pointer
- CBotVar* var = CBotVar::Create(m_var->GivToken(), m_typevar);
+ CBotVar* var = CBotVar::Create(m_var->GetToken(), m_typevar);
var->SetPointer(NULL);
var->SetUniqNum(((CBotLeftExprVar*)m_var)->m_nIdent);
pj->AddVar(var);
@@ -681,7 +681,7 @@ bool CBotInstArray::Execute(CBotStack* &pj)
pile1->IncState();
}
- if (pile1->GivState() == 1)
+ if (pile1->GetState() == 1)
{
if (m_listass != NULL) // there is the assignment for this table
{
@@ -704,7 +704,7 @@ void CBotInstArray::RestoreState(CBotStack* &pj, bool bMain)
{
CBotStack* pile1 = pj;
- CBotVar* var = pj->FindVar(m_var->GivToken()->GivString());
+ CBotVar* var = pj->FindVar(m_var->GetToken()->GetString());
if (var != NULL) var->SetUniqNum(((CBotLeftExprVar*)m_var)->m_nIdent);
if (bMain)
@@ -713,24 +713,24 @@ void CBotInstArray::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pile1;
if (pile == NULL) return;
- if (pile1->GivState() == 0)
+ if (pile1->GetState() == 0)
{
// seek the maximum dimension of the table
- CBotInstr* p = GivNext3b();
+ CBotInstr* p = GetNext3b();
while (p != NULL)
{
pile = pile->RestoreStack();
if (pile == NULL) return;
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
p->RestoreState(pile, bMain);
return;
}
- p = p->GivNext3b();
+ p = p->GetNext3b();
}
}
- if (pile1->GivState() == 1 && m_listass != NULL)
+ if (pile1->GetState() == 1 && m_listass != NULL)
{
m_listass->RestoreState(pile1, bMain);
}
@@ -790,9 +790,9 @@ CBotInstr* CBotListArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
// each element takes the one after the other
if (type.Eq( CBotTypArrayPointer ))
{
- type = type.GivTypElem();
+ type = type.GetTypElem();
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
if (NULL == ( inst->m_expr = CBotListArray::Compile( p, pStk, type ) ))
{
goto error;
@@ -800,7 +800,7 @@ CBotInstr* CBotListArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
while (IsOfType( p, ID_COMMA )) // other elements?
{
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
CBotInstr* i = CBotListArray::Compile(p, pStk, type);
if (NULL == i)
@@ -813,22 +813,22 @@ CBotInstr* CBotListArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
}
else
{
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
if (NULL == ( inst->m_expr = CBotTwoOpExpr::Compile( p, pStk )))
{
goto error;
}
- CBotVar* pv = pStk->GivVar(); // result of the expression
+ CBotVar* pv = pStk->GetVar(); // result of the expression
- if (pv == NULL || !TypesCompatibles( type, pv->GivTypResult())) // compatible type?
+ if (pv == NULL || !TypesCompatibles( type, pv->GetTypResult())) // compatible type?
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
while (IsOfType( p, ID_COMMA )) // other elements?
{
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
CBotInstr* i = CBotTwoOpExpr::Compile(p, pStk) ;
if (NULL == i)
@@ -836,11 +836,11 @@ CBotInstr* CBotListArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
goto error;
}
- CBotVar* pv = pStk->GivVar(); // result of the expression
+ CBotVar* pv = pStk->GetVar(); // result of the expression
- if (pv == NULL || !TypesCompatibles( type, pv->GivTypResult())) // compatible type?
+ if (pv == NULL || !TypesCompatibles( type, pv->GetTypResult())) // compatible type?
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
inst->m_expr->AddNext3(i);
@@ -849,7 +849,7 @@ CBotInstr* CBotListArray::Compile(CBotToken* &p, CBotCStack* pStack, CBotTypResu
if (!IsOfType(p, ID_CLOSEPAR) )
{
- pStk->SetError(TX_CLOSEPAR, p->GivStart());
+ pStk->SetError(TX_CLOSEPAR, p->GetStart());
goto error;
}
@@ -873,11 +873,11 @@ bool CBotListArray::Execute(CBotStack* &pj, CBotVar* pVar)
int n = 0;
- for (; p != NULL ; n++, p = p->GivNext3())
+ for (; p != NULL ; n++, p = p->GetNext3())
{
- if (pile1->GivState() > n) continue;
+ if (pile1->GetState() > n) continue;
- pVar2 = pVar->GivItem(n, true);
+ pVar2 = pVar->GetItem(n, true);
if (!p->Execute(pile1, pVar2)) return false; // evaluate expression
@@ -896,9 +896,9 @@ void CBotListArray::RestoreState(CBotStack* &pj, bool bMain)
CBotInstr* p = m_expr;
- int state = pile->GivState();
+ int state = pile->GetState();
- while(state-- > 0) p = p->GivNext3() ;
+ while(state-- > 0) p = p->GetNext3() ;
p->RestoreState(pile, bMain); // size calculation //interrupted!
}
@@ -930,7 +930,7 @@ CBotInstr* CBotInstr::CompileArray(CBotToken* &p, CBotCStack* pStack, CBotTypRes
{
if (!IsOfType(p, ID_CLBRK))
{
- pStack->SetError(TX_CLBRK, p->GivStart());
+ pStack->SetError(TX_CLBRK, p->GetStart());
return NULL;
}
@@ -960,7 +960,7 @@ CBotInstr* CBotInstr::CompileArray(CBotToken* &p, CBotCStack* pStack, CBotTypRes
}
delete inst;
- pStack->SetError(TX_ENDOF, p->GivStart());
+ pStack->SetError(TX_ENDOF, p->GetStart());
return NULL;
}
@@ -1003,7 +1003,7 @@ CBotInstr* CBotInt::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bool n
if (!pStk->IsOk() )
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto error;
}
@@ -1024,9 +1024,9 @@ CBotInstr* CBotInt::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bool n
{
goto error;
}
- if (pStk->GivType() >= CBotTypBoolean) // compatible type ?
+ if (pStk->GetType() >= CBotTypBoolean) // compatible type ?
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
}
@@ -1052,7 +1052,7 @@ suite:
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
error:
@@ -1066,7 +1066,7 @@ bool CBotInt::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this); // essential for SetState()
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr && !m_expr->Execute(pile)) return false; // initial value // interrupted?
m_var->Execute(pile); // creates and assign the result
@@ -1090,7 +1090,7 @@ void CBotInt::RestoreState(CBotStack* &pj, bool bMain)
pile = pj->RestoreStack(this);
if (pile == NULL) return;
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr) m_expr->RestoreState(pile, bMain); // initial value // interrupted?
return;
@@ -1161,7 +1161,7 @@ CBotInstr* CBotBoolean::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bo
if (!pStk->IsOk() )
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto error;
}
goto suite; // no assignment, variable already created
@@ -1173,9 +1173,9 @@ CBotInstr* CBotBoolean::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bo
{
goto error;
}
- if (!pStk->GivTypResult().Eq(CBotTypBoolean))
+ if (!pStk->GetTypResult().Eq(CBotTypBoolean))
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
}
@@ -1199,7 +1199,7 @@ suite:
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
error:
@@ -1213,7 +1213,7 @@ bool CBotBoolean::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);//essential for SetState()
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr && !m_expr->Execute(pile)) return false;
m_var->Execute(pile);
@@ -1237,7 +1237,7 @@ void CBotBoolean::RestoreState(CBotStack* &pj, bool bMain)
pile = pj->RestoreStack(this);
if (pile == NULL) return;
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr) m_expr->RestoreState(pile, bMain); // initial value interrupted?
return;
@@ -1294,8 +1294,8 @@ CBotInstr* CBotFloat::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bool
((CBotLeftExprVar*)inst->m_var)->m_typevar = CBotTypFloat;
if (pStk->CheckVarLocal(vartoken)) // redefinition of a variable
{
- pStk->SetStartError(vartoken->GivStart());
- pStk->SetError(TX_REDEFVAR, vartoken->GivEnd());
+ pStk->SetStartError(vartoken->GetStart());
+ pStk->SetError(TX_REDEFVAR, vartoken->GetEnd());
goto error;
}
@@ -1307,7 +1307,7 @@ CBotInstr* CBotFloat::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bool
if (!pStk->IsOk() )
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto error;
}
goto suite; // no assignment, variable already created
@@ -1319,9 +1319,9 @@ CBotInstr* CBotFloat::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bool
{
goto error;
}
- if (pStk->GivType() >= CBotTypBoolean)
+ if (pStk->GetType() >= CBotTypBoolean)
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
}
@@ -1345,7 +1345,7 @@ suite:
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
error:
@@ -1359,7 +1359,7 @@ bool CBotFloat::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr && !m_expr->Execute(pile)) return false;
m_var->Execute(pile);
@@ -1383,7 +1383,7 @@ void CBotFloat::RestoreState(CBotStack* &pj, bool bMain)
pile = pj->RestoreStack(this);
if (pile == NULL) return;
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr) m_expr->RestoreState(pile, bMain);
return;
@@ -1439,8 +1439,8 @@ CBotInstr* CBotIString::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bo
((CBotLeftExprVar*)inst->m_var)->m_typevar = CBotTypString;
if (pStk->CheckVarLocal(vartoken))
{
- pStk->SetStartError(vartoken->GivStart());
- pStk->SetError(TX_REDEFVAR, vartoken->GivEnd());
+ pStk->SetStartError(vartoken->GetStart());
+ pStk->SetError(TX_REDEFVAR, vartoken->GetEnd());
goto error;
}
@@ -1450,9 +1450,9 @@ CBotInstr* CBotIString::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bo
{
goto error;
}
-/* if (!pStk->GivTypResult().Eq(CBotTypString)) // type compatible ?
+/* if (!pStk->GetTypResult().Eq(CBotTypString)) // type compatible ?
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}*/
}
@@ -1476,7 +1476,7 @@ CBotInstr* CBotIString::Compile(CBotToken* &p, CBotCStack* pStack, bool cont, bo
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
error:
@@ -1490,7 +1490,7 @@ bool CBotIString::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr && !m_expr->Execute(pile)) return false;
m_var->Execute(pile);
@@ -1515,7 +1515,7 @@ void CBotIString::RestoreState(CBotStack* &pj, bool bMain)
pile = pj->RestoreStack(this);
if (pile == NULL) return;
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
if (m_expr) m_expr->RestoreState(pile, bMain);
return;
@@ -1558,7 +1558,7 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
inst->m_leftop = CBotLeftExpr::Compile(p, pStack);
inst->SetToken(p);
- int OpType = p->GivType();
+ int OpType = p->GetType();
if ( pStack->IsOk() &&
IsOfTypeList(p, ID_ASS, ID_ASSADD, ID_ASSSUB, ID_ASSMUL, ID_ASSDIV, ID_ASSMODULO,
@@ -1567,7 +1567,7 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
{
if (inst->m_leftop == NULL)
{
- pStack->SetError(TX_BADLEFT, p->GivEnd());
+ pStack->SetError(TX_BADLEFT, p->GetEnd());
delete inst;
return NULL;
}
@@ -1579,7 +1579,7 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
return NULL;
}
- CBotTypResult type1 = pStack->GivTypResult();
+ CBotTypResult type1 = pStack->GetTypResult();
// get the variable assigned to mark
CBotVar* var = NULL;
@@ -1590,14 +1590,14 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
return NULL;
}
- if (OpType != ID_ASS && var->GivInit() != IS_DEF)
+ if (OpType != ID_ASS && var->GetInit() != IS_DEF)
{
pStack->SetError(TX_NOTINIT, pp);
delete inst;
return NULL;
}
- CBotTypResult type2 = var->GivTypResult();
+ CBotTypResult type2 = var->GetTypResult();
// what types are acceptable?
switch (OpType)
@@ -1607,10 +1607,10 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
if ((type1.Eq(CBotTypPointer) && type2.Eq(CBotTypPointer)) ||
(type1.Eq(CBotTypClass) && type2.Eq(CBotTypClass) ) )
{
-/* CBotClass* c1 = type1.GivClass();
- CBotClass* c2 = type2.GivClass();
+/* CBotClass* c1 = type1.GetClass();
+ CBotClass* c2 = type2.GetClass();
if (!c1->IsChildOf(c2)) type2.SetType(-1);
-//- if (!type1.Eq(CBotTypClass)) var->SetPointer(pStack->GivVar()->GivPointer());*/
+//- if (!type1.Eq(CBotTypClass)) var->SetPointer(pStack->GetVar()->GetPointer());*/
var->SetInit(2);
}
else
@@ -1625,7 +1625,7 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
case ID_ASSMUL:
case ID_ASSDIV:
case ID_ASSMODULO:
- if (type2.GivType() >= CBotTypBoolean) type2 = -1; // numbers only
+ if (type2.GetType() >= CBotTypBoolean) type2 = -1; // numbers only
break;
}
@@ -1640,13 +1640,13 @@ CBotInstr* CBotExpression::Compile(CBotToken* &p, CBotCStack* pStack)
}
delete inst;
- int start, end, error = pStack->GivError(start, end);
+ int start, end, error = pStack->GetError(start, end);
p = pp; // returns to the top
pStack->SetError(0,0); // forget the error
CBotInstr* i = CBotTwoOpExpr::Compile(p, pStack); // tries without assignment
- if (i != NULL && error == TX_PRIVATE && p->GivType() == ID_ASS)
+ if (i != NULL && error == TX_PRIVATE && p->GetType() == ID_ASS)
pStack->ResetError(error, start, end);
return i;
}
@@ -1657,7 +1657,7 @@ bool CBotExpression::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
- CBotToken* pToken = m_leftop->GivToken();
+ CBotToken* pToken = m_leftop->GetToken();
CBotVar* pVar = NULL;
CBotStack* pile1 = pile;
@@ -1668,7 +1668,7 @@ bool CBotExpression::Execute(CBotStack* &pj)
// must be done before any indexes (stack can be changed)
if (!m_leftop->ExecuteVar(pVar, pile, NULL, false)) return false; // variable before accessing the value on the right
- if ( pile1->GivState()==0)
+ if ( pile1->GetState()==0)
{
pile1->SetCopyVar(pVar); // keeps the copy on the stack (if interrupted)
pile1->IncState();
@@ -1676,83 +1676,83 @@ bool CBotExpression::Execute(CBotStack* &pj)
CBotStack* pile2 = pile->AddStack();
- if ( pile2->GivState()==0)
+ if ( pile2->GetState()==0)
{
if (m_rightop && !m_rightop->Execute(pile2)) return false; // initial value // interrupted?
pile2->IncState();
}
- if (pile1->GivState() == 1)
+ if (pile1->GetState() == 1)
{
- if (m_token.GivType() != ID_ASS)
+ if (m_token.GetType() != ID_ASS)
{
- pVar = pile1->GivVar(); // recovers if interrupted
- IsInit = pVar->GivInit();
+ pVar = pile1->GetVar(); // recovers if interrupted
+ IsInit = pVar->GetInit();
if (IsInit == IS_NAN)
{
- pile2->SetError(TX_OPNAN, m_leftop->GivToken());
+ pile2->SetError(TX_OPNAN, m_leftop->GetToken());
return pj->Return(pile2);
}
- result = CBotVar::Create("", pVar->GivTypResult(2));
+ result = CBotVar::Create("", pVar->GetTypResult(2));
}
- switch (m_token.GivType())
+ switch (m_token.GetType())
{
case ID_ASS:
break;
case ID_ASSADD:
- result->Add(pile1->GivVar(), pile2->GivVar());
+ result->Add(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSSUB:
- result->Sub(pile1->GivVar(), pile2->GivVar());
+ result->Sub(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSMUL:
- result->Mul(pile1->GivVar(), pile2->GivVar());
+ result->Mul(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSDIV:
if (IsInit &&
- result->Div(pile1->GivVar(), pile2->GivVar()))
+ result->Div(pile1->GetVar(), pile2->GetVar()))
pile2->SetError(TX_DIVZERO, &m_token);
pile2->SetVar(result);
break;
case ID_ASSMODULO:
if (IsInit &&
- result->Modulo(pile1->GivVar(), pile2->GivVar()))
+ result->Modulo(pile1->GetVar(), pile2->GetVar()))
pile2->SetError(TX_DIVZERO, &m_token);
pile2->SetVar(result);
break;
case ID_ASSAND:
- result->And(pile1->GivVar(), pile2->GivVar());
+ result->And(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSXOR:
- result->XOr(pile1->GivVar(), pile2->GivVar());
+ result->XOr(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSOR:
- result->Or(pile1->GivVar(), pile2->GivVar());
+ result->Or(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSSL:
- result->SL(pile1->GivVar(), pile2->GivVar());
+ result->SL(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSSR:
- result->SR(pile1->GivVar(), pile2->GivVar());
+ result->SR(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
case ID_ASSASR:
- result->ASR(pile1->GivVar(), pile2->GivVar());
+ result->ASR(pile1->GetVar(), pile2->GetVar());
pile2->SetVar(result);
break;
default:
ASM_TRAP();
}
if (!IsInit)
- pile2->SetError(TX_NOTINIT, m_leftop->GivToken());
+ pile2->SetError(TX_NOTINIT, m_leftop->GetToken());
pile1->IncState();
}
@@ -1768,7 +1768,7 @@ void CBotExpression::RestoreState(CBotStack* &pj, bool bMain)
{
if (bMain)
{
- CBotToken* pToken = m_leftop->GivToken();
+ CBotToken* pToken = m_leftop->GetToken();
CBotVar* pVar = NULL;
CBotStack* pile = pj->RestoreStack(this);
@@ -1776,7 +1776,7 @@ void CBotExpression::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile1 = pile;
- if ( pile1->GivState()==0)
+ if ( pile1->GetState()==0)
{
m_leftop->RestoreStateVar(pile, true);
return;
@@ -1787,7 +1787,7 @@ void CBotExpression::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile2 = pile->RestoreStack();
if (pile2 == NULL) return;
- if ( pile2->GivState()==0)
+ if ( pile2->GetState()==0)
{
if (m_rightop) m_rightop->RestoreState(pile2, bMain);
return;
@@ -1808,7 +1808,7 @@ void CBotExpression::RestoreState(CBotStack* &pj, bool bMain)
CBotInstr* CBotCondition::Compile(CBotToken* &p, CBotCStack* pStack)
{
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
if (IsOfType(p, ID_OPENPAR))
{
CBotInstr* inst = CBotBoolExpr::Compile(p, pStack);
@@ -1818,12 +1818,12 @@ CBotInstr* CBotCondition::Compile(CBotToken* &p, CBotCStack* pStack)
{
return inst;
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart()); // missing parenthesis
+ pStack->SetError(TX_CLOSEPAR, p->GetStart()); // missing parenthesis
}
delete inst;
}
- pStack->SetError(TX_OPENPAR, p->GivStart()); // missing parenthesis
+ pStack->SetError(TX_OPENPAR, p->GetStart()); // missing parenthesis
return NULL;
}
@@ -1840,17 +1840,17 @@ CBotInstr* CBotCondition::Compile(CBotToken* &p, CBotCStack* pStack)
CBotInstr* CBotBoolExpr::Compile(CBotToken* &p, CBotCStack* pStack)
{
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
CBotInstr* inst = CBotTwoOpExpr::Compile(p, pStack);
if (NULL != inst)
{
- if (pStack->GivTypResult().Eq(CBotTypBoolean))
+ if (pStack->GetTypResult().Eq(CBotTypBoolean))
{
return inst;
}
- pStack->SetError(TX_NOTBOOL, p->GivStart()); // is not a boolean
+ pStack->SetError(TX_NOTBOOL, p->GetStart()); // is not a boolean
}
delete inst;
@@ -1879,7 +1879,7 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
{
CBotCStack* pStk = pStack->TokenStack();
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
// is it an expression in parentheses?
if (IsOfType(p, ID_OPENPAR))
@@ -1892,7 +1892,7 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
{
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_CLOSEPAR, p->GivStart());
+ pStk->SetError(TX_CLOSEPAR, p->GetStart());
}
delete inst;
return pStack->Return(NULL, pStk);
@@ -1904,7 +1904,7 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
return pStack->Return(inst, pStk);
// is it a variable name?
- if (p->GivType() == TokenTypVar)
+ if (p->GetType() == TokenTypVar)
{
// this may be a method call without the "this." before
inst = CBotExprVar::CompileMethode(p, pStk);
@@ -1925,7 +1925,7 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
// post incremented or decremented?
if (IsOfType(p, ID_INC, ID_DEC))
{
- if (pStk->GivType() >= CBotTypBoolean)
+ if (pStk->GetType() >= CBotTypBoolean)
{
pStk->SetError(TX_BADTYPE, pp);
delete inst;
@@ -1936,7 +1936,7 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
delete inst;
p = pvar;
inst = CBotExprVar::Compile(p, pStk, PR_READ);
- p = p->GivNext();
+ p = p->GetNext();
CBotPostIncExpr* i = new CBotPostIncExpr();
i->SetToken(pp);
@@ -1953,11 +1953,11 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
CBotPreIncExpr* i = new CBotPreIncExpr();
i->SetToken(pp);
- if (p->GivType() == TokenTypVar)
+ if (p->GetType() == TokenTypVar)
{
if (NULL != (i->m_Instr = CBotExprVar::Compile(p, pStk, PR_READ)))
{
- if (pStk->GivType() >= CBotTypBoolean)
+ if (pStk->GetType() >= CBotTypBoolean)
{
pStk->SetError(TX_BADTYPE, pp);
delete inst;
@@ -1971,30 +1971,30 @@ CBotInstr* CBotParExpr::Compile(CBotToken* &p, CBotCStack* pStack)
}
// is it a number or DefineNum?
- if (p->GivType() == TokenTypNum ||
- p->GivType() == TokenTypDef )
+ if (p->GetType() == TokenTypNum ||
+ p->GetType() == TokenTypDef )
{
CBotInstr* inst = CBotExprNum::Compile(p, pStk);
return pStack->Return(inst, pStk);
}
// is this a chaine?
- if (p->GivType() == TokenTypString)
+ if (p->GetType() == TokenTypString)
{
CBotInstr* inst = CBotExprAlpha::Compile(p, pStk);
return pStack->Return(inst, pStk);
}
// is a "true" or "false"
- if (p->GivType() == ID_TRUE ||
- p->GivType() == ID_FALSE )
+ if (p->GetType() == ID_TRUE ||
+ p->GetType() == ID_FALSE )
{
CBotInstr* inst = CBotExprBool::Compile(p, pStk);
return pStack->Return(inst, pStk);
}
// is an object to be created with new
- if (p->GivType() == ID_NEW)
+ if (p->GetType() == ID_NEW)
{
CBotInstr* inst = CBotNew::Compile(p, pStk);
return pStack->Return(inst, pStk);
@@ -2071,17 +2071,17 @@ bool CBotPostIncExpr::Execute(CBotStack* &pj)
CBotStack* pile3 = pile2->AddStack(this);
if (pile3->IfStep()) return false;
- if (var1->GivInit() == IS_NAN)
+ if (var1->GetInit() == IS_NAN)
{
pile1->SetError(TX_OPNAN, &m_token);
}
- if (var1->GivInit() != IS_DEF)
+ if (var1->GetInit() != IS_DEF)
{
pile1->SetError(TX_NOTINIT, &m_token);
}
- if (GivTokenType() == ID_INC) var1->Inc();
+ if (GetTokenType() == ID_INC) var1->Inc();
else var1->Dec();
return pj->Return(pile1); // operation done, result on pile2
@@ -2107,26 +2107,26 @@ bool CBotPreIncExpr::Execute(CBotStack* &pj)
CBotVar* var1;
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
CBotStack* pile2 = pile;
// retrieves the variable fields and indexes according
// pile2 is modified on return
if (!((CBotExprVar*)m_Instr)->ExecuteVar(var1, pile2, NULL, true)) return false;
- if (var1->GivInit() == IS_NAN)
+ if (var1->GetInit() == IS_NAN)
{
pile->SetError(TX_OPNAN, &m_token);
return pj->Return(pile); // operation performed
}
- if (var1->GivInit() != IS_DEF)
+ if (var1->GetInit() != IS_DEF)
{
pile->SetError(TX_NOTINIT, &m_token);
return pj->Return(pile); // operation performed
}
- if (GivTokenType() == ID_INC) var1->Inc();
+ if (GetTokenType() == ID_INC) var1->Inc();
else var1->Dec(); // ((CBotVarInt*)var1)->m_val
pile->IncState();
@@ -2144,7 +2144,7 @@ void CBotPreIncExpr::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this);
if (pile == NULL) return;
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
return;
}
@@ -2174,7 +2174,7 @@ CBotExprUnaire::~CBotExprUnaire()
CBotInstr* CBotExprUnaire::Compile(CBotToken* &p, CBotCStack* pStack)
{
- int op = p->GivType();
+ int op = p->GetType();
CBotToken* pp = p;
if (!IsOfTypeList( p, ID_ADD, ID_SUB, ID_LOG_NOT, ID_TXT_NOT, ID_NOT, 0 )) return NULL;
@@ -2185,15 +2185,15 @@ CBotInstr* CBotExprUnaire::Compile(CBotToken* &p, CBotCStack* pStack)
if (NULL != (inst->m_Expr = CBotParExpr::Compile( p, pStk )))
{
- if (op == ID_ADD && pStk->GivType() < CBotTypBoolean) // only with the number
+ if (op == ID_ADD && pStk->GetType() < CBotTypBoolean) // only with the number
return pStack->Return(inst, pStk);
- if (op == ID_SUB && pStk->GivType() < CBotTypBoolean) // only with the numer
+ if (op == ID_SUB && pStk->GetType() < CBotTypBoolean) // only with the numer
return pStack->Return(inst, pStk);
- if (op == ID_NOT && pStk->GivType() < CBotTypFloat) // only with an integer
+ if (op == ID_NOT && pStk->GetType() < CBotTypFloat) // only with an integer
return pStack->Return(inst, pStk);
- if (op == ID_LOG_NOT && pStk->GivTypResult().Eq(CBotTypBoolean))// only with boolean
+ if (op == ID_LOG_NOT && pStk->GetTypResult().Eq(CBotTypBoolean))// only with boolean
return pStack->Return(inst, pStk);
- if (op == ID_TXT_NOT && pStk->GivTypResult().Eq(CBotTypBoolean))// only with boolean
+ if (op == ID_TXT_NOT && pStk->GetTypResult().Eq(CBotTypBoolean))// only with boolean
return pStack->Return(inst, pStk);
pStk->SetError(TX_BADTYPE, &inst->m_token);
@@ -2208,7 +2208,7 @@ bool CBotExprUnaire::Execute(CBotStack* &pj)
{
CBotStack* pile = pj->AddStack(this);
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
if (!m_Expr->Execute(pile)) return false; // interrupted ?
pile->IncState();
@@ -2217,9 +2217,9 @@ bool CBotExprUnaire::Execute(CBotStack* &pj)
CBotStack* pile2 = pile->AddStack();
if (pile2->IfStep()) return false;
- CBotVar* var = pile->GivVar(); // get the result on the stack
+ CBotVar* var = pile->GetVar(); // get the result on the stack
- switch (GivTokenType())
+ switch (GetTokenType())
{
case ID_ADD:
break;
@@ -2242,7 +2242,7 @@ void CBotExprUnaire::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this);
if ( pile == NULL) return;
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
m_Expr->RestoreState(pile, bMain); // interrupted here!
return;
@@ -2271,13 +2271,13 @@ CBotIndexExpr::~CBotIndexExpr()
bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
{
- if (pVar->GivType(1) != CBotTypArrayPointer)
+ if (pVar->GetType(1) != CBotTypArrayPointer)
ASM_TRAP();
- pVar = ((CBotVarArray*)pVar)->GivItem(0, false); // at compile time makes the element [0]
+ pVar = ((CBotVarArray*)pVar)->GetItem(0, false); // at compile time makes the element [0]
if (pVar == NULL)
{
- pile->SetError(TX_OUTARRAY, m_token.GivEnd());
+ pile->SetError(TX_OUTARRAY, m_token.GetEnd());
return false;
}
if (m_next3 != NULL) return m_next3->ExecuteVar(pVar, pile);
@@ -2292,36 +2292,36 @@ bool CBotIndexExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
{
CBotStack* pj = pile;
- if (pVar->GivType(1) != CBotTypArrayPointer)
+ if (pVar->GetType(1) != CBotTypArrayPointer)
ASM_TRAP();
pile = pile->AddStack();
- if (pile->GivState() == 0)
+ if (pile->GetState() == 0)
{
if (!m_expr->Execute(pile)) return false;
pile->IncState();
}
// handles array
- CBotVar* p = pile->GivVar(); // result on the stack
+ CBotVar* p = pile->GetVar(); // result on the stack
- if (p == NULL || p->GivType() > CBotTypDouble)
+ if (p == NULL || p->GetType() > CBotTypDouble)
{
pile->SetError(TX_BADINDEX, prevToken);
return pj->Return(pile);
}
- int n = p->GivValInt(); // position in the table
+ int n = p->GetValInt(); // position in the table
- pVar = ((CBotVarArray*)pVar)->GivItem(n, bExtend);
+ pVar = ((CBotVarArray*)pVar)->GetItem(n, bExtend);
if (pVar == NULL)
{
pile->SetError(TX_OUTARRAY, prevToken);
return pj->Return(pile);
}
- pVar->Maj(pile->GivPUser(), true);
+ pVar->Maj(pile->GetPUser(), true);
if ( m_next3 != NULL &&
!m_next3->ExecuteVar(pVar, pile, prevToken, bStep, bExtend) ) return false;
@@ -2336,7 +2336,7 @@ void CBotIndexExpr::RestoreStateVar(CBotStack* &pile, bool bMain)
pile = pile->RestoreStack();
if (pile == NULL) return;
- if (bMain && pile->GivState() == 0)
+ if (bMain && pile->GetState() == 0)
{
m_expr->RestoreState(pile, true);
return;
@@ -2373,10 +2373,10 @@ void CBotFieldExpr::SetUniqNum(int num)
bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotCStack* &pile)
{
- if (pVar->GivType(1) != CBotTypPointer)
+ if (pVar->GetType(1) != CBotTypPointer)
ASM_TRAP();
- pVar = pVar->GivItemRef(m_nIdent);
+ pVar = pVar->GetItemRef(m_nIdent);
if (pVar == NULL)
{
pile->SetError(TX_NOITEM, &m_token);
@@ -2396,16 +2396,16 @@ bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
if (pile == EOX) return true;
- if (pVar->GivType(1) != CBotTypPointer)
+ if (pVar->GetType(1) != CBotTypPointer)
ASM_TRAP();
- CBotVarClass* pItem = pVar->GivPointer();
+ CBotVarClass* pItem = pVar->GetPointer();
if (pItem == NULL)
{
pile->SetError(TX_NULLPT, prevToken);
return pj->Return(pile);
}
- if (pItem->GivUserPtr() == OBJECTDELETED)
+ if (pItem->GetUserPtr() == OBJECTDELETED)
{
pile->SetError(TX_DELETEDPT, prevToken);
return pj->Return(pile);
@@ -2413,7 +2413,7 @@ bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
if (bStep && pile->IfStep()) return false;
- pVar = pVar->GivItemRef(m_nIdent);
+ pVar = pVar->GetItemRef(m_nIdent);
if (pVar == NULL)
{
pile->SetError(TX_NOITEM, &m_token);
@@ -2423,12 +2423,12 @@ bool CBotFieldExpr::ExecuteVar(CBotVar* &pVar, CBotStack* &pile, CBotToken* prev
if (pVar->IsStatic())
{
// for a static variable, takes it in the class itself
- CBotClass* pClass = pItem->GivClass();
- pVar = pClass->GivItem(m_token.GivString());
+ CBotClass* pClass = pItem->GetClass();
+ pVar = pClass->GetItem(m_token.GetString());
}
// request the update of the element, if applicable
- pVar->Maj(pile->GivPUser(), true);
+ pVar->Maj(pile->GetPUser(), true);
if ( m_next3 != NULL &&
!m_next3->ExecuteVar(pVar, pile, &m_token, bStep, bExtend) ) return false;
@@ -2476,10 +2476,10 @@ CBotLeftExpr* CBotLeftExpr::Compile(CBotToken* &p, CBotCStack* pStack)
{
CBotCStack* pStk = pStack->TokenStack();
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
// is it a variable name?
- if (p->GivType() == TokenTypVar)
+ if (p->GetType() == TokenTypVar)
{
CBotLeftExpr* inst = new CBotLeftExpr(); // creates the object
@@ -2489,11 +2489,11 @@ CBotLeftExpr* CBotLeftExpr::Compile(CBotToken* &p, CBotCStack* pStack)
if (NULL != (var = pStk->FindVar(p))) // seek if known variable
{
- inst->m_nIdent = var->GivUniqNum();
+ inst->m_nIdent = var->GetUniqNum();
if (inst->m_nIdent > 0 && inst->m_nIdent < 9000)
{
if ( var->IsPrivate(PR_READ) &&
- !pStk->GivBotCall()->m_bCompileClass)
+ !pStk->GetBotCall()->m_bCompileClass)
{
pStk->SetError(TX_PRIVATE, p);
goto err;
@@ -2509,14 +2509,14 @@ CBotLeftExpr* CBotLeftExpr::Compile(CBotToken* &p, CBotCStack* pStack)
inst->AddNext3(i); // add after
var = pStk->FindVar(pthis);
- var = var->GivItem(p->GivString());
- i->SetUniqNum(var->GivUniqNum());
+ var = var->GetItem(p->GetString());
+ i->SetUniqNum(var->GetUniqNum());
}
- p = p->GivNext(); // next token
+ p = p->GetNext(); // next token
while (true)
{
- if (var->GivType() == CBotTypArrayPointer)
+ if (var->GetType() == CBotTypArrayPointer)
{
if (IsOfType( p, ID_OPBRK ))
{
@@ -2524,24 +2524,24 @@ CBotLeftExpr* CBotLeftExpr::Compile(CBotToken* &p, CBotCStack* pStack)
i->m_expr = CBotExpression::Compile(p, pStk);
inst->AddNext3(i); // add to the chain
- var = ((CBotVarArray*)var)->GivItem(0,true); // gets the component [0]
+ var = ((CBotVarArray*)var)->GetItem(0,true); // gets the component [0]
if (i->m_expr == NULL)
{
- pStk->SetError(TX_BADINDEX, p->GivStart());
+ pStk->SetError(TX_BADINDEX, p->GetStart());
goto err;
}
if (!pStk->IsOk() || !IsOfType( p, ID_CLBRK ))
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto err;
}
continue;
}
}
- if (var->GivType(1) == CBotTypPointer) // for classes
+ if (var->GetType(1) == CBotTypPointer) // for classes
{
if (IsOfType(p, ID_DOT))
{
@@ -2551,25 +2551,25 @@ CBotLeftExpr* CBotLeftExpr::Compile(CBotToken* &p, CBotCStack* pStack)
i->SetToken(pp); // keeps the name of the token
inst->AddNext3(i); // adds after
- if (p->GivType() == TokenTypVar) // must be a name
+ if (p->GetType() == TokenTypVar) // must be a name
{
- var = var->GivItem(p->GivString()); // get item correspondent
+ var = var->GetItem(p->GetString()); // get item correspondent
if (var != NULL)
{
if ( var->IsPrivate(PR_READ) &&
- !pStk->GivBotCall()->m_bCompileClass)
+ !pStk->GetBotCall()->m_bCompileClass)
{
pStk->SetError(TX_PRIVATE, pp);
goto err;
}
- i->SetUniqNum(var->GivUniqNum());
- p = p->GivNext(); // skips the name
+ i->SetUniqNum(var->GetUniqNum());
+ p = p->GetNext(); // skips the name
continue;
}
pStk->SetError(TX_NOITEM, p);
}
- pStk->SetError(TX_DOT, p->GivStart());
+ pStk->SetError(TX_DOT, p->GetStart());
goto err;
}
}
@@ -2602,15 +2602,15 @@ bool CBotLeftExpr::Execute(CBotStack* &pj, CBotStack* array)
if (var1)
{
- var2 = pj->GivVar(); // result on the input stack
+ var2 = pj->GetVar(); // result on the input stack
if (var2)
{
- CBotTypResult t1 = var1->GivTypResult();
- CBotTypResult t2 = var2->GivTypResult();
+ CBotTypResult t1 = var1->GetTypResult();
+ CBotTypResult t2 = var2->GetTypResult();
if (t2.Eq(CBotTypPointer))
{
- CBotClass* c1 = t1.GivClass();
- CBotClass* c2 = t2.GivClass();
+ CBotClass* c1 = t1.GetClass();
+ CBotClass* c2 = t2.GetClass();
if ( !c2->IsChildOf(c1))
{
CBotToken* pt = &m_token;
@@ -2678,7 +2678,7 @@ void CBotLeftExpr::RestoreStateVar(CBotStack* &pile, bool bMain)
// converts a string into integer
// may be of the form 0xabc123
-long GivNumInt(const char* p)
+long GetNumInt(const char* p)
{
long num = 0;
while (*p >= '0' && *p <= '9')
@@ -2712,7 +2712,7 @@ long GivNumInt(const char* p)
}
// converts a string into a float number
-extern float GivNumFloat(const char* p)
+extern float GetNumFloat(const char* p)
{
double num = 0;
double div = 10;
@@ -2792,23 +2792,23 @@ CBotInstr* CBotExprNum::Compile(CBotToken* &p, CBotCStack* pStack)
CBotExprNum* inst = new CBotExprNum();
inst->SetToken(p);
- CBotString s = p->GivString();
+ CBotString s = p->GetString();
inst->m_numtype = CBotTypInt;
- if (p->GivType() == TokenTypDef)
+ if (p->GetType() == TokenTypDef)
{
- inst->m_valint = p->GivIdKey();
+ inst->m_valint = p->GetIdKey();
}
else
{
if (s.Find('.') >= 0 || ( s.Find('x') < 0 && ( s.Find('e') >= 0 || s.Find('E') >= 0 ) ))
{
inst->m_numtype = CBotTypFloat;
- inst->m_valfloat = GivNumFloat(s);
+ inst->m_valfloat = GetNumFloat(s);
}
else
{
- inst->m_valint = GivNumInt(s);
+ inst->m_valint = GetNumInt(s);
}
}
@@ -2834,9 +2834,9 @@ bool CBotExprNum::Execute(CBotStack* &pj)
CBotVar* var = CBotVar::Create((CBotToken*)NULL, m_numtype);
CBotString nombre ;
- if (m_token.GivType() == TokenTypDef)
+ if (m_token.GetType() == TokenTypDef)
{
- nombre = m_token.GivString();
+ nombre = m_token.GetString();
}
switch (m_numtype)
@@ -2881,7 +2881,7 @@ CBotInstr* CBotExprAlpha::Compile(CBotToken* &p, CBotCStack* pStack)
CBotExprAlpha* inst = new CBotExprAlpha();
inst->SetToken(p);
- p = p->GivNext();
+ p = p->GetNext();
CBotVar* var = CBotVar::Create((CBotToken*)NULL, CBotTypString);
pStk->SetVar(var);
@@ -2899,8 +2899,8 @@ bool CBotExprAlpha::Execute(CBotStack* &pj)
CBotVar* var = CBotVar::Create((CBotToken*)NULL, CBotTypString);
- CBotString chaine = m_token.GivString();
- chaine = chaine.Mid(1, chaine.GivLength()-2); // removes the quotes
+ CBotString chaine = m_token.GetString();
+ chaine = chaine.Mid(1, chaine.GetLength()-2); // removes the quotes
var->SetValString(chaine); // value of the number
@@ -2934,12 +2934,12 @@ CBotInstr* CBotExprBool::Compile(CBotToken* &p, CBotCStack* pStack)
CBotCStack* pStk = pStack->TokenStack();
CBotExprBool* inst = NULL;
- if ( p->GivType() == ID_TRUE ||
- p->GivType() == ID_FALSE )
+ if ( p->GetType() == ID_TRUE ||
+ p->GetType() == ID_FALSE )
{
inst = new CBotExprBool();
inst->SetToken(p); // stores the operation false or true
- p = p->GivNext();
+ p = p->GetNext();
CBotVar* var = CBotVar::Create((CBotToken*)NULL, CBotTypBoolean);
pStk->SetVar(var);
@@ -2958,7 +2958,7 @@ bool CBotExprBool::Execute(CBotStack* &pj)
CBotVar* var = CBotVar::Create((CBotToken*)NULL, CBotTypBoolean);
- if (GivTokenType() == ID_TRUE) var->SetValInt(1);
+ if (GetTokenType() == ID_TRUE) var->SetValInt(1);
else var->SetValInt(0);
pile->SetVar(var); // put on the stack
@@ -3054,10 +3054,10 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
CBotToken* pDebut = p;
CBotCStack* pStk = pStack->TokenStack();
- pStk->SetStartError(p->GivStart());
+ pStk->SetStartError(p->GetStart());
// is it a variable?
- if (p->GivType() == TokenTypVar)
+ if (p->GetType() == TokenTypVar)
{
CBotInstr* inst = new CBotExprVar(); // create the object
@@ -3067,13 +3067,13 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
if (NULL != (var = pStk->FindVar(p))) // seek if known variable
{
- int ident = var->GivUniqNum();
+ int ident = var->GetUniqNum();
((CBotExprVar*)inst)->m_nIdent = ident; // identifies variable by its number
if (ident > 0 && ident < 9000)
{
if ( var->IsPrivate(privat) &&
- !pStk->GivBotCall()->m_bCompileClass)
+ !pStk->GetBotCall()->m_bCompileClass)
{
pStk->SetError(TX_PRIVATE, p);
goto err;
@@ -3093,11 +3093,11 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
inst->AddNext3(i); // added after
}
- p = p->GivNext(); // next token
+ p = p->GetNext(); // next token
while (true)
{
- if (var->GivType() == CBotTypArrayPointer)
+ if (var->GetType() == CBotTypArrayPointer)
{
if (IsOfType( p, ID_OPBRK )) // check if there is an aindex
{
@@ -3105,30 +3105,30 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
i->m_expr = CBotExpression::Compile(p, pStk); // compile the formula
inst->AddNext3(i); // add to the chain
- var = ((CBotVarArray*)var)->GivItem(0,true); // gets the component [0]
+ var = ((CBotVarArray*)var)->GetItem(0,true); // gets the component [0]
if (i->m_expr == NULL)
{
- pStk->SetError(TX_BADINDEX, p->GivStart());
+ pStk->SetError(TX_BADINDEX, p->GetStart());
goto err;
}
if (!pStk->IsOk() || !IsOfType( p, ID_CLBRK ))
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto err;
}
continue;
}
}
- if (var->GivType(1) == CBotTypPointer) // for classes
+ if (var->GetType(1) == CBotTypPointer) // for classes
{
if (IsOfType(p, ID_DOT))
{
CBotToken* pp = p;
- if (p->GivType() == TokenTypVar) // must be a name
+ if (p->GetType() == TokenTypVar) // must be a name
{
- if (p->GivNext()->GivType() == ID_OPENPAR) // a method call?
+ if (p->GetNext()->GetType() == ID_OPENPAR) // a method call?
{
CBotInstr* i = CBotInstrMethode::Compile(p, pStk, var);
if (!pStk->IsOk()) goto err;
@@ -3140,12 +3140,12 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
CBotFieldExpr* i = new CBotFieldExpr(); // new element
i->SetToken(pp); // keeps the name of the token
inst->AddNext3(i); // add after
- var = var->GivItem(p->GivString()); // get item correspondent
+ var = var->GetItem(p->GetString()); // get item correspondent
if (var != NULL)
{
- i->SetUniqNum(var->GivUniqNum());
+ i->SetUniqNum(var->GetUniqNum());
if ( var->IsPrivate() &&
- !pStk->GivBotCall()->m_bCompileClass)
+ !pStk->GetBotCall()->m_bCompileClass)
{
pStk->SetError(TX_PRIVATE, pp);
goto err;
@@ -3156,13 +3156,13 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
if (var != NULL)
{
- p = p->GivNext(); // skips the name
+ p = p->GetNext(); // skips the name
continue;
}
pStk->SetError(TX_NOITEM, p);
goto err;
}
- pStk->SetError(TX_DOT, p->GivStart());
+ pStk->SetError(TX_DOT, p->GetStart());
goto err;
}
}
@@ -3187,10 +3187,10 @@ CBotInstr* CBotExprVar::CompileMethode(CBotToken* &p, CBotCStack* pStack)
CBotToken* pp = p;
CBotCStack* pStk = pStack->TokenStack();
- pStk->SetStartError(pp->GivStart());
+ pStk->SetStartError(pp->GetStart());
// is it a variable ?
- if (pp->GivType() == TokenTypVar)
+ if (pp->GetType() == TokenTypVar)
{
CBotToken pthis("this");
CBotVar* var = pStk->FindVar(pthis);
@@ -3206,9 +3206,9 @@ CBotInstr* CBotExprVar::CompileMethode(CBotToken* &p, CBotCStack* pStack)
CBotToken* pp = p;
- if (pp->GivType() == TokenTypVar)
+ if (pp->GetType() == TokenTypVar)
{
- if (pp->GivNext()->GivType() == ID_OPENPAR) // a method call?
+ if (pp->GetNext()->GetType() == ID_OPENPAR) // a method call?
{
CBotInstr* i = CBotInstrMethode::Compile(pp, pStk, var);
if (pStk->IsOk())
@@ -3235,7 +3235,7 @@ bool CBotExprVar::Execute(CBotStack* &pj)
CBotStack* pile1 = pile;
- if (pile1->GivState() == 0)
+ if (pile1->GetState() == 0)
{
if (!ExecuteVar(pVar, pile, NULL, true)) return false; // Get the variable fields and indexes according
@@ -3247,17 +3247,17 @@ bool CBotExprVar::Execute(CBotStack* &pj)
pile1->IncState();
}
- pVar = pile1->GivVar();
+ pVar = pile1->GetVar();
if (pVar == NULL)
{
return pj->Return(pile1);
}
- if (pVar->GivInit() == IS_UNDEF)
+ if (pVar->GetInit() == IS_UNDEF)
{
CBotToken* pt = &m_token;
- while (pt->GivNext() != NULL) pt = pt->GivNext();
+ while (pt->GetNext() != NULL) pt = pt->GetNext();
pile1->SetError(TX_NOTINIT, pt);
return pj->Return(pile1);
}
@@ -3273,7 +3273,7 @@ void CBotExprVar::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile1 = pile;
- if (pile1->GivState() == 0)
+ if (pile1->GetState() == 0)
{
RestoreStateVar(pile, bMain); // retrieves the variable fields and indexes according
return;
@@ -3334,14 +3334,14 @@ CBotInstr* CompileParams(CBotToken* &p, CBotCStack* pStack, CBotVar** ppVars)
int start, end;
if (!IsOfType(p, ID_CLOSEPAR)) while (true)
{
- start = p->GivStart();
+ start = p->GetStart();
pile = pile->TokenStack(); // keeps the result on the stack
if (first) pStack->SetStartError(start);
first = false;
CBotInstr* param = CBotExpression::Compile(p, pile);
- end = p->GivStart();
+ end = p->GetStart();
if (!pile->IsOk())
{
@@ -3353,21 +3353,21 @@ CBotInstr* CompileParams(CBotToken* &p, CBotCStack* pStack, CBotVar** ppVars)
if (param != NULL)
{
- if (pile->GivTypResult().Eq(99))
+ if (pile->GetTypResult().Eq(99))
{
delete pStack->TokenStack();
- pStack->SetError(TX_VOID, p->GivStart());
+ pStack->SetError(TX_VOID, p->GetStart());
return NULL;
}
- ppVars[i] = pile->GivVar();
- ppVars[i]->GivToken()->SetPos(start, end);
+ ppVars[i] = pile->GetVar();
+ ppVars[i]->GetToken()->SetPos(start, end);
i++;
if (IsOfType(p, ID_COMMA)) continue; // skips the comma
if (IsOfType(p, ID_CLOSEPAR)) break;
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
delete pStack->TokenStack();
return NULL;
}
@@ -3402,11 +3402,11 @@ CBotInstr* CBotInstrMethode::Compile(CBotToken* &p, CBotCStack* pStack, CBotVar*
if (NULL != var)
{
CBotToken* pp = p;
- p = p->GivNext();
+ p = p->GetNext();
- if (p->GivType() == ID_OPENPAR)
+ if (p->GetType() == ID_OPENPAR)
{
- inst->m_NomMethod = pp->GivString();
+ inst->m_NomMethod = pp->GetString();
// compiles the list of parameters
CBotVar* ppVars[1000];
@@ -3414,26 +3414,26 @@ CBotInstr* CBotInstrMethode::Compile(CBotToken* &p, CBotCStack* pStack, CBotVar*
if (pStack->IsOk())
{
- CBotClass* pClass = var->GivClass(); // pointer to the class
- inst->m_ClassName = pClass->GivName(); // name of the class
+ CBotClass* pClass = var->GetClass(); // pointer to the class
+ inst->m_ClassName = pClass->GetName(); // name of the class
CBotTypResult r = pClass->CompileMethode(inst->m_NomMethod, var, ppVars,
pStack, inst->m_MethodeIdent);
delete pStack->TokenStack(); // release parameters on the stack
inst->m_typRes = r;
- if (inst->m_typRes.GivType() > 20)
+ if (inst->m_typRes.GetType() > 20)
{
- pStack->SetError(inst->m_typRes.GivType(), pp);
+ pStack->SetError(inst->m_typRes.GetType(), pp);
delete inst;
return NULL;
}
// put the result on the stack to have something
- if (inst->m_typRes.GivType() > 0)
+ if (inst->m_typRes.GetType() > 0)
{
CBotVar* pResult = CBotVar::Create("", inst->m_typRes);
if (inst->m_typRes.Eq(CBotTypClass))
{
- pResult->SetClass(inst->m_typRes.GivClass());
+ pResult->SetClass(inst->m_typRes.GetClass());
}
pStack->SetVar(pResult);
}
@@ -3455,7 +3455,7 @@ bool CBotInstrMethode::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* pre
CBotVar* ppVars[1000];
CBotStack* pile1 = pj->AddStack(this, true); // a place for the copy of This
- if (pVar->GivPointer() == NULL)
+ if (pVar->GetPointer() == NULL)
{
pj->SetError(TX_NULLPT, prevToken);
}
@@ -3464,7 +3464,7 @@ bool CBotInstrMethode::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* pre
CBotStack* pile2 = pile1->AddStack(); // for the next parameters
- if ( pile1->GivState() == 0)
+ if ( pile1->GetState() == 0)
{
CBotVar* pThis = CBotVar::Create(pVar);
pThis->Copy(pVar);
@@ -3486,14 +3486,14 @@ bool CBotInstrMethode::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* pre
if (p != NULL) while ( true)
{
- if (pile2->GivState() == 0)
+ if (pile2->GetState() == 0)
{
if (!p->Execute(pile2)) return false; // interrupted here?
if (!pile2->SetState(1)) return false; // special mark to recognize parameters
}
- ppVars[i++] = pile2->GivVar(); // construct the list of pointers
+ ppVars[i++] = pile2->GetVar(); // construct the list of pointers
pile2 = pile2->AddStack(); // space on the stack for the result
- p = p->GivNext();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -3501,16 +3501,16 @@ bool CBotInstrMethode::ExecuteVar(CBotVar* &pVar, CBotStack* &pj, CBotToken* pre
CBotClass* pClass = CBotClass::Find(m_ClassName);
CBotVar* pThis = pile1->FindVar(-2);
CBotVar* pResult = NULL;
- if (m_typRes.GivType() > 0) pResult = CBotVar::Create("", m_typRes);
+ if (m_typRes.GetType() > 0) pResult = CBotVar::Create("", m_typRes);
if (m_typRes.Eq(CBotTypClass))
{
- pResult->SetClass(m_typRes.GivClass());
+ pResult->SetClass(m_typRes.GetClass());
}
CBotVar* pRes = pResult;
if ( !pClass->ExecuteMethode(m_MethodeIdent, m_NomMethod,
pThis, ppVars,
- pResult, pile2, GivToken())) return false;
+ pResult, pile2, GetToken())) return false;
if (pRes != pResult) delete pRes;
pVar = NULL; // does not return value for this
@@ -3540,16 +3540,16 @@ void CBotInstrMethode::RestoreStateVar(CBotStack* &pile, bool bMain)
if (p != NULL) while ( true)
{
- if (pile2->GivState() == 0)
+ if (pile2->GetState() == 0)
{
p->RestoreState(pile2, true); // interrupted here!
return;
}
- ppVars[i++] = pile2->GivVar(); // construct the list of pointers
+ ppVars[i++] = pile2->GetVar(); // construct the list of pointers
pile2 = pile2->RestoreStack();
if (pile2 == NULL) return;
- p = p->GivNext();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -3573,7 +3573,7 @@ bool CBotInstrMethode::Execute(CBotStack* &pj)
CBotStack* pile2 = pile1->AddStack(); // and for the parameters coming
- if ( pile1->GivState() == 0)
+ if ( pile1->GetState() == 0)
{
CBotVar* pThis = pile1->CopyVar(m_token);
// this value should be taken before the evaluation parameters
@@ -3591,14 +3591,14 @@ bool CBotInstrMethode::Execute(CBotStack* &pj)
// to be interrupted at any time
if (p != NULL) while ( true)
{
- if (pile2->GivState() == 0)
+ if (pile2->GetState() == 0)
{
if (!p->Execute(pile2)) return false; // interrupted here?
if (!pile2->SetState(1)) return false; // special mark to recognize parameters
}
- ppVars[i++] = pile2->GivVar(); // construct the list of pointers
+ ppVars[i++] = pile2->GetVar(); // construct the list of pointers
pile2 = pile2->AddStack(); // space on the stack for the results
- p = p->GivNext();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -3606,16 +3606,16 @@ bool CBotInstrMethode::Execute(CBotStack* &pj)
CBotClass* pClass = CBotClass::Find(m_ClassName);
CBotVar* pThis = pile1->FindVar("this");
CBotVar* pResult = NULL;
- if (m_typRes.GivType()>0) pResult = CBotVar::Create("", m_typRes);
+ if (m_typRes.GetType()>0) pResult = CBotVar::Create("", m_typRes);
if (m_typRes.Eq(CBotTypClass))
{
- pResult->SetClass(m_typRes.GivClass());
+ pResult->SetClass(m_typRes.GetClass());
}
CBotVar* pRes = pResult;
if ( !pClass->ExecuteMethode(m_MethodeIdent, m_NomMethod,
pThis, ppVars,
- pResult, pile2, GivToken())) return false; // interupted
+ pResult, pile2, GetToken())) return false; // interupted
// set the new value of this in place of the old variable
CBotVar* old = pile1->FindVar(m_token);
@@ -3648,7 +3648,7 @@ CBotInstr* CBotNew::Compile(CBotToken* &p, CBotCStack* pStack)
if (!IsOfType(p, ID_NEW)) return NULL;
// verifies that the token is a class name
- if (p->GivType() != TokenTypVar) return NULL;
+ if (p->GetType() != TokenTypVar) return NULL;
CBotClass* pClass = CBotClass::Find(p);
if (pClass == NULL)
@@ -3661,7 +3661,7 @@ CBotInstr* CBotNew::Compile(CBotToken* &p, CBotCStack* pStack)
inst->SetToken(pp);
inst->m_vartoken = p;
- p = p->GivNext();
+ p = p->GetNext();
// creates the object on the "job"
// with a pointer to the object
@@ -3676,9 +3676,9 @@ CBotInstr* CBotNew::Compile(CBotToken* &p, CBotCStack* pStack)
if (!pStk->IsOk()) goto error;
// constructor exist?
- CBotTypResult r = pClass->CompileMethode(pClass->GivName(), pVar, ppVars, pStk, inst->m_nMethodeIdent);
+ CBotTypResult r = pClass->CompileMethode(pClass->GetName(), pVar, ppVars, pStk, inst->m_nMethodeIdent);
delete pStk->TokenStack(); // release extra stack
- int typ = r.GivType();
+ int typ = r.GetType();
// if there is no constructor, and no parameters either, it's ok
if (typ == TX_UNDEFCALL && inst->m_Parameters == NULL) typ = 0;
@@ -3686,7 +3686,7 @@ CBotInstr* CBotNew::Compile(CBotToken* &p, CBotCStack* pStack)
if (typ>20)
{
- pStk->SetError(typ, inst->m_vartoken.GivEnd());
+ pStk->SetError(typ, inst->m_vartoken.GetEnd());
goto error;
}
@@ -3723,7 +3723,7 @@ bool CBotNew::Execute(CBotStack* &pj)
// create the variable "this" pointer type to the stack
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
// create an instance of the requested class
// and initialize the pointer to that object
@@ -3739,11 +3739,11 @@ bool CBotNew::Execute(CBotStack* &pj)
// fetch the this pointer if it was interrupted
if ( pThis == NULL)
{
- pThis = pile1->GivVar(); // find the pointer
+ pThis = pile1->GetVar(); // find the pointer
}
// is there an assignment or parameters (constructor)
- if ( pile->GivState()==1)
+ if ( pile->GetState()==1)
{
// evaluates the constructor of the instance
@@ -3760,13 +3760,13 @@ bool CBotNew::Execute(CBotStack* &pj)
if (p != NULL) while ( true)
{
pile2 = pile2->AddStack(); // space on the stack for the result
- if (pile2->GivState() == 0)
+ if (pile2->GetState() == 0)
{
if (!p->Execute(pile2)) return false; // interrupted here?
pile2->SetState(1);
}
- ppVars[i++] = pile2->GivVar();
- p = p->GivNext();
+ ppVars[i++] = pile2->GetVar();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -3774,9 +3774,9 @@ bool CBotNew::Execute(CBotStack* &pj)
// create a variable for the result
CBotVar* pResult = NULL; // constructos still void
- if ( !pClass->ExecuteMethode(m_nMethodeIdent, pClass->GivName(),
+ if ( !pClass->ExecuteMethode(m_nMethodeIdent, pClass->GetName(),
pThis, ppVars,
- pResult, pile2, GivToken())) return false; // interrupt
+ pResult, pile2, GetToken())) return false; // interrupt
pThis->ConstructorSet(); // indicates that the constructor has been called
}
@@ -3798,16 +3798,16 @@ void CBotNew::RestoreState(CBotStack* &pj, bool bMain)
// create the variable "this" pointer type to the object
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
return;
}
- CBotVar* pThis = pile1->GivVar(); // find the pointer
+ CBotVar* pThis = pile1->GetVar(); // find the pointer
pThis->SetUniqNum(-2);
// is ther an assignment or parameters (constructor)
- if ( pile->GivState()==1)
+ if ( pile->GetState()==1)
{
// evaluates the constructor of the instance
@@ -3826,18 +3826,18 @@ void CBotNew::RestoreState(CBotStack* &pj, bool bMain)
pile2 = pile2->RestoreStack(); // space on the stack for the result
if (pile2 == NULL) return;
- if (pile2->GivState() == 0)
+ if (pile2->GetState() == 0)
{
p->RestoreState(pile2, bMain); // interrupt here!
return;
}
- ppVars[i++] = pile2->GivVar();
- p = p->GivNext();
+ ppVars[i++] = pile2->GetVar();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
- pClass->RestoreMethode(m_nMethodeIdent, m_vartoken.GivString(), pThis,
+ pClass->RestoreMethode(m_nMethodeIdent, m_vartoken.GetString(), pThis,
ppVars, pile2) ; // interrupt here!
}
}
@@ -3847,8 +3847,8 @@ void CBotNew::RestoreState(CBotStack* &pj, bool bMain)
bool TypeCompatible(CBotTypResult& type1, CBotTypResult& type2, int op)
{
- int t1 = type1.GivType();
- int t2 = type2.GivType();
+ int t1 = type1.GetType();
+ int t2 = type2.GetType();
int max = (t1 > t2) ? t1 : t2;
@@ -3875,8 +3875,8 @@ bool TypeCompatible(CBotTypResult& type1, CBotTypResult& type2, int op)
t1 == CBotTypClass ||
t1 == CBotTypIntrinsic )
{
- CBotClass* c1 = type1.GivClass();
- CBotClass* c2 = type2.GivClass();
+ CBotClass* c1 = type1.GetClass();
+ CBotClass* c2 = type2.GetClass();
return c1->IsChildOf(c2) || c2->IsChildOf(c1);
// accept the case in reverse
@@ -3896,8 +3896,8 @@ bool TypeCompatible(CBotTypResult& type1, CBotTypResult& type2, int op)
bool TypesCompatibles(const CBotTypResult& type1, const CBotTypResult& type2)
{
- int t1 = type1.GivType();
- int t2 = type2.GivType();
+ int t1 = type1.GetType();
+ int t2 = type2.GetType();
if (t1 == CBotTypIntrinsic) t1 = CBotTypClass;
if (t2 == CBotTypIntrinsic) t2 = CBotTypClass;
@@ -3911,10 +3911,10 @@ bool TypesCompatibles(const CBotTypResult& type1, const CBotTypResult& type2)
if (t2 != t1) return false;
if (max == CBotTypArrayPointer)
- return TypesCompatibles(type1.GivTypElem(), type2.GivTypElem());
+ return TypesCompatibles(type1.GetTypElem(), type2.GetTypElem());
if (max == CBotTypClass || max == CBotTypPointer)
- return type1.GivClass() == type2.GivClass() ;
+ return type1.GetClass() == type2.GetClass() ;
return true ;
}
diff --git a/src/CBot/CBot.h b/src/CBot/CBot.h
index ebc8e52..924d37b 100644
--- a/src/CBot/CBot.h
+++ b/src/CBot/CBot.h
@@ -105,18 +105,18 @@ public:
bool StackOver();
/**
- * \brief GivError Get error number of the stack
+ * \brief GetError Get error number of the stack
* \param [out] start beginning of the stack
* \param [out] end end of stack
* \return error number
*/
- int GivError(int& start, int& end);
+ int GetError(int& start, int& end);
/**
- * \brief GivError Get error number
+ * \brief GetError Get error number
* \return eror number
*/
- int GivError();// rend le numéro d'erreur retourné
+ int GetError();// rend le numéro d'erreur retourné
/**
* \brief Reset Reset error at and set user
@@ -131,18 +131,18 @@ public:
void SetType(CBotTypResult& type);
/**
- * \brief GivType Get the type of value on the stack.
+ * \brief GetType Get the type of value on the stack.
* \param [in] mode Used when getting class type (1 gives pointer, 2 gives intrinsic).
* \return Type number.
*/
- int GivType(int mode = 0);
+ int GetType(int mode = 0);
/**
- * \brief Gives the type of complete value on the stack.
+ * \brief Getes the type of complete value on the stack.
* \param [in] mode Used when getting class type (1 gives pointer, 2 gives intrinsic).
* \return Type of an element.
*/
- CBotTypResult GivTypResult(int mode = 0);
+ CBotTypResult GetTypResult(int mode = 0);
/**
* \brief Adds a local variable.
@@ -215,18 +215,18 @@ public:
bool IsOk();
bool SetState(int n, int lim = -10); // select a state
- int GivState(); // in what state am I?
+ int GetState(); // in what state am I?
bool IncState(int lim = -10); // passes to the next state
bool IfStep(); // do step by step
bool Execute();
void SetVar( CBotVar* var );
void SetCopyVar( CBotVar* var );
- CBotVar* GivVar();
- CBotVar* GivCopyVar();
- CBotVar* GivPtVar();
- bool GivRetVar(bool bRet);
- long GivVal();
+ CBotVar* GetVar();
+ CBotVar* GetCopyVar();
+ CBotVar* GetPtVar();
+ bool GetRetVar(bool bRet);
+ long GetVal();
void SetStartError(int pos);
void SetError(int n, CBotToken* token = NULL);
@@ -235,9 +235,9 @@ public:
void SetBreak(int val, const char* name);
void SetBotCall(CBotProgram* p);
- CBotProgram* GivBotCall(bool bFirst = false);
- void* GivPUser();
- bool GivBlock();
+ CBotProgram* GetBotCall(bool bFirst = false);
+ void* GetPUser();
+ bool GetBlock();
bool ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotTypResult& rettype);
@@ -250,7 +250,7 @@ public:
void SetTimer(int n);
void GetRunPos(const char* &FunctionName, int &start, int &end);
- CBotVar* GivStackVars(const char* &FunctionName, int level);
+ CBotVar* GetStackVars(const char* &FunctionName, int level);
int m_temp;
@@ -301,12 +301,12 @@ inline bool CBotStack::IsOk()
return (m_error == 0);
}
-inline int CBotStack::GivState()
+inline int CBotStack::GetState()
{
return m_state;
}
-inline int CBotStack::GivError()
+inline int CBotStack::GetError()
{
return m_error;
}
@@ -343,14 +343,14 @@ public:
~CBotCStack();
bool IsOk();
- int GivError();
- int GivError(int& start, int& end);
+ int GetError();
+ int GetError(int& start, int& end);
// gives error number
void SetType(CBotTypResult& type);// determines the type
- CBotTypResult GivTypResult(int mode = 0); // gives the type of value on the stack
- int GivType(int mode = 0); // gives the type of value on the stack
- CBotClass* GivClass(); // gives the class of the value on the stack
+ CBotTypResult GetTypResult(int mode = 0); // gives the type of value on the stack
+ int GetType(int mode = 0); // gives the type of value on the stack
+ CBotClass* GetClass(); // gives the class of the value on the stack
void AddVar(CBotVar* p); // adds a local variable
CBotVar* FindVar(CBotToken* &p); // finds a variable
@@ -364,7 +364,7 @@ public:
void SetVar( CBotVar* var );
void SetCopyVar( CBotVar* var );
- CBotVar* GivVar();
+ CBotVar* GetVar();
void SetStartError(int pos);
void SetError(int n, int pos);
@@ -372,11 +372,11 @@ public:
void ResetError(int n, int start, int end);
void SetRetType(CBotTypResult& type);
- CBotTypResult GivRetType();
+ CBotTypResult GetRetType();
// void SetBotCall(CBotFunction* &pFunc);
void SetBotCall(CBotProgram* p);
- CBotProgram* GivBotCall();
+ CBotProgram* GetBotCall();
CBotTypResult CompileCall(CBotToken* &p, CBotVar** ppVars, long& nIdent);
bool CheckCall(CBotToken* &pToken, CBotDefParam* pParam);
@@ -454,15 +454,15 @@ public:
bool CompCase(CBotStack* &pj, int val);
void SetToken(CBotToken* p);
- int GivTokenType();
- CBotToken* GivToken();
+ int GetTokenType();
+ CBotToken* GetToken();
void AddNext(CBotInstr* n);
- CBotInstr* GivNext();
+ CBotInstr* GetNext();
void AddNext3(CBotInstr* n);
- CBotInstr* GivNext3();
+ CBotInstr* GetNext3();
void AddNext3b(CBotInstr* n);
- CBotInstr* GivNext3b();
+ CBotInstr* GetNext3b();
static
void IncLvl(CBotString& label);
@@ -1263,9 +1263,9 @@ public:
void SetValInt(int val, const char* s = NULL);
void SetValFloat(float val);
- int GivValInt();
- float GivValFloat();
- CBotString GivValString();
+ int GetValInt();
+ float GetValFloat();
+ CBotString GetValString();
void Copy(CBotVar* pSrc, bool bName=true);
@@ -1314,9 +1314,9 @@ public:
void SetValInt(int val, const char* s = NULL);
void SetValFloat(float val);
- int GivValInt();
- float GivValFloat();
- CBotString GivValString();
+ int GetValInt();
+ float GetValFloat();
+ CBotString GetValString();
void Copy(CBotVar* pSrc, bool bName=true);
@@ -1354,7 +1354,7 @@ public:
// ~CBotVarString();
void SetValString(const char* p);
- CBotString GivValString();
+ CBotString GetValString();
void Copy(CBotVar* pSrc, bool bName=true);
@@ -1382,9 +1382,9 @@ public:
void SetValInt(int val, const char* s = NULL);
void SetValFloat(float val);
- int GivValInt();
- float GivValFloat();
- CBotString GivValString();
+ int GetValInt();
+ float GetValFloat();
+ CBotString GetValString();
void Copy(CBotVar* pSrc, bool bName=true);
@@ -1426,14 +1426,14 @@ public:
void Copy(CBotVar* pSrc, bool bName=true);
void SetClass(CBotClass* pClass); //, int &nIdent);
- CBotClass* GivClass();
- CBotVar* GivItem(const char* name); // return an element of a class according to its name (*)
- CBotVar* GivItemRef(int nIdent);
+ CBotClass* GetClass();
+ CBotVar* GetItem(const char* name); // return an element of a class according to its name (*)
+ CBotVar* GetItemRef(int nIdent);
- CBotVar* GivItem(int n, bool bExtend);
- CBotVar* GivItemList();
+ CBotVar* GetItem(int n, bool bExtend);
+ CBotVar* GetItemList();
- CBotString GivValString();
+ CBotString GetValString();
bool Save1State(FILE* pf);
void Maj(void* pUser, bool bContinue);
@@ -1442,7 +1442,7 @@ public:
void DecrementUse(); // a reference to decrementation
CBotVarClass*
- GivPointer();
+ GetPointer();
void SetItemList(CBotVar* pVar);
void SetIdent(long n);
@@ -1450,7 +1450,7 @@ public:
static CBotVarClass* Find(long id);
-// CBotVar* GivMyThis();
+// CBotVar* GetMyThis();
bool Eq(CBotVar* left, CBotVar* right);
bool Ne(CBotVar* left, CBotVar* right);
@@ -1474,18 +1474,18 @@ public:
void Copy(CBotVar* pSrc, bool bName=true);
void SetClass(CBotClass* pClass);
- CBotClass* GivClass();
- CBotVar* GivItem(const char* name); // return an element of a class according to its name (*)
- CBotVar* GivItemRef(int nIdent);
- CBotVar* GivItemList();
+ CBotClass* GetClass();
+ CBotVar* GetItem(const char* name); // return an element of a class according to its name (*)
+ CBotVar* GetItemRef(int nIdent);
+ CBotVar* GetItemList();
- CBotString GivValString();
+ CBotString GetValString();
void SetPointer(CBotVar* p);
CBotVarClass*
- GivPointer();
+ GetPointer();
void SetIdent(long n); // associates an identification number (unique)
- long GivIdent(); // gives the identification number associated with
+ long GetIdent(); // gives the identification number associated with
void ConstructorSet();
bool Save1State(FILE* pf);
@@ -1514,15 +1514,15 @@ public:
void SetPointer(CBotVar* p);
CBotVarClass*
- GivPointer();
+ GetPointer();
void Copy(CBotVar* pSrc, bool bName=true);
- CBotVar* GivItem(int n, bool bGrow=false); // makes an element according to its numeric index
+ CBotVar* GetItem(int n, bool bGrow=false); // makes an element according to its numeric index
// enlarged the table if necessary if bExtend
-// CBotVar* GivItem(const char* name); // makes a element by literal index
- CBotVar* GivItemList(); // gives the first item in the list
+// CBotVar* GetItem(const char* name); // makes a element by literal index
+ CBotVar* GetItemList(); // gives the first item in the list
- CBotString GivValString(); // gets the contents of the array into a string
+ CBotString GetValString(); // gets the contents of the array into a string
bool Save1State(FILE* pf);
};
@@ -1544,7 +1544,7 @@ 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 );
+extern float GetNumFloat( const char* p );
#if false
extern void DEBUG( const char* text, int val, CBotStack* pile );
@@ -1596,7 +1596,7 @@ public:
bool RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotStack* pStack);
#endif
- CBotString GivName();
+ CBotString GetName();
CBotCall* Next();
static void SetPUser(void* pUser);
@@ -1629,7 +1629,7 @@ public:
int DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppVars, CBotVar* &pResult, CBotStack* pStack, CBotToken* pFunc);
- CBotString GivName();
+ CBotString GetName();
CBotCallMethode* Next();
void AddNext(CBotCallMethode* p);
@@ -1655,11 +1655,11 @@ public:
void RestoreState(CBotStack* &pj, bool bMain);
void AddNext(CBotDefParam* p);
- int GivType();
- CBotTypResult GivTypResult();
- CBotDefParam* GivNext();
+ int GetType();
+ CBotTypResult GetTypResult();
+ CBotDefParam* GetNext();
- CBotString GivParamString();
+ CBotString GetParamString();
};
@@ -1720,8 +1720,8 @@ public:
static
void AddPublic(CBotFunction* pfunc);
- CBotString GivName();
- CBotString GivParams();
+ CBotString GetName();
+ CBotString GetParams();
bool IsPublic();
bool IsExtern();
CBotFunction* Next();
diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp
index a524a8e..5fac74c 100644
--- a/src/CBot/CBotClass.cpp
+++ b/src/CBot/CBotClass.cpp
@@ -175,7 +175,7 @@ void CBotClass::FreeLock(CBotProgram* p)
bool CBotClass::AddItem(CBotString name, CBotTypResult type, int mPrivate)
{
CBotToken token(name, CBotString());
- CBotClass* pClass = type.GivClass();
+ CBotClass* pClass = type.GetClass();
CBotVar* pVar = CBotVar::Create( name, type );
/// pVar->SetUniqNum(CBotVar::NextUniqNum());
@@ -188,7 +188,7 @@ bool CBotClass::AddItem(CBotString name, CBotTypResult type, int mPrivate)
{
// adds a new statement for the object initialization
pVar->m_InitExpr = new CBotNew() ;
- CBotToken nom( pClass->GivName() );
+ CBotToken nom( pClass->GetName() );
pVar->m_InitExpr->SetToken(&nom);
}
}
@@ -214,12 +214,12 @@ void CBotClass::AddNext(CBotClass* pClass)
p->m_next = pClass;
}
-CBotString CBotClass::GivName()
+CBotString CBotClass::GetName()
{
return m_name;
}
-CBotClass* CBotClass::GivParent()
+CBotClass* CBotClass::GetParent()
{
if ( this == NULL ) return NULL;
return m_pParent;
@@ -237,34 +237,34 @@ bool CBotClass::IsChildOf(CBotClass* pClass)
}
-CBotVar* CBotClass::GivVar()
+CBotVar* CBotClass::GetVar()
{
return m_pVar;
}
-CBotVar* CBotClass::GivItem(const char* name)
+CBotVar* CBotClass::GetItem(const char* name)
{
CBotVar* p = m_pVar;
while ( p != NULL )
{
- if ( p->GivName() == name ) return p;
- p = p->GivNext();
+ if ( p->GetName() == name ) return p;
+ p = p->GetNext();
}
- if ( m_pParent != NULL ) return m_pParent->GivItem(name);
+ if ( m_pParent != NULL ) return m_pParent->GetItem(name);
return NULL;
}
-CBotVar* CBotClass::GivItemRef(int nIdent)
+CBotVar* CBotClass::GetItemRef(int nIdent)
{
CBotVar* p = m_pVar;
while ( p != NULL )
{
- if ( p->GivUniqNum() == nIdent ) return p;
- p = p->GivNext();
+ if ( p->GetUniqNum() == nIdent ) return p;
+ p = p->GetNext();
}
- if ( m_pParent != NULL ) return m_pParent->GivItemRef(nIdent);
+ if ( m_pParent != NULL ) return m_pParent->GetItemRef(nIdent);
return NULL;
}
@@ -275,7 +275,7 @@ bool CBotClass::IsIntrinsic()
CBotClass* CBotClass::Find(CBotToken* &pToken)
{
- return Find(pToken->GivString());
+ return Find(pToken->GetString());
}
CBotClass* CBotClass::Find(const char* name)
@@ -284,7 +284,7 @@ CBotClass* CBotClass::Find(const char* name)
while ( p != NULL )
{
- if ( p->GivName() == name ) return p;
+ if ( p->GetName() == name ) return p;
p = p->m_ExNext;
}
@@ -301,7 +301,7 @@ bool CBotClass::AddFunction(const char* name,
while ( p != NULL )
{
- if ( name == p->GivName() )
+ if ( name == p->GetName() )
{
if ( pp == NULL ) m_pCalls = p->m_next;
else pp->m_next = p->m_next;
@@ -338,7 +338,7 @@ CBotTypResult CBotClass::CompileMethode(const char* name,
// find the methods declared by AddFunction
CBotTypResult r = m_pCalls->CompileCall(name, pThis, ppParams, pStack, nIdent);
- if ( r.GivType() >= 0) return r;
+ if ( r.GetType() >= 0) return r;
// find the methods declared by user
@@ -384,21 +384,21 @@ bool CBotClass::SaveStaticState(FILE* pf)
{
if (!WriteWord( pf, 1)) return false;
// save the name of the class
- if (!WriteString( pf, p->GivName() )) return false;
+ if (!WriteString( pf, p->GetName() )) return false;
- CBotVar* pv = p->GivVar();
+ CBotVar* pv = p->GetVar();
while( pv != NULL )
{
if ( pv->IsStatic() )
{
if (!WriteWord( pf, 1)) return false;
- if (!WriteString( pf, pv->GivName() )) return false;
+ if (!WriteString( pf, pv->GetName() )) return false;
if ( !pv->Save0State(pf)) return false; // common header
if ( !pv->Save1State(pf) ) return false; // saves as the child class
if ( !WriteWord( pf, 0)) return false;
}
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
if (!WriteWord( pf, 0)) return false;
@@ -435,7 +435,7 @@ bool CBotClass::RestoreStaticState(FILE* pf)
CBotVar* pv = NULL;
if (!ReadString( pf, VarName )) return false;
- if ( pClass != NULL ) pVar = pClass->GivItem(VarName);
+ if ( pClass != NULL ) pVar = pClass->GetItem(VarName);
if (!CBotVar::RestoreState(pf, pv)) return false; // the temp variable
@@ -475,7 +475,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
// seeks the corresponding classes
if ( pClass == NULL )
{
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
pClass = CBotClass::Find(p);
if ( pClass == NULL )
{
@@ -483,7 +483,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
pStack->SetError(TX_NOCLASS, p);
return NULL;
}
- p = p->GivNext();
+ p = p->GetNext();
}
bool bIntrinsic = pClass->IsIntrinsic();
@@ -495,7 +495,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
inst = new CBotClassInst();
/// \TODO Need to be revised and fixed after adding unit tests
- CBotToken token(pClass->GivName(), CBotString(), p->GivStart(), p->GivEnd());
+ CBotToken token(pClass->GetName(), CBotString(), p->GetStart(), p->GetEnd());
inst->SetToken(&token);
CBotToken* vartoken = p;
@@ -504,8 +504,8 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
((CBotLeftExprVar*)inst->m_var)->m_typevar = type;
if (pStk->CheckVarLocal(vartoken)) // redefinition of the variable
{
- pStk->SetStartError(vartoken->GivStart());
- pStk->SetError(TX_REDEFVAR, vartoken->GivEnd());
+ pStk->SetStartError(vartoken->GetStart());
+ pStk->SetError(TX_REDEFVAR, vartoken->GetEnd());
goto error;
}
@@ -520,7 +520,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
if (!pStk->IsOk() )
{
- pStk->SetError(TX_CLBRK, p->GivStart());
+ pStk->SetError(TX_CLBRK, p->GetStart());
goto error;
}
goto suite; // no assignment, variable already created
@@ -528,7 +528,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
CBotVar* var;
- var = CBotVar::Create(vartoken->GivString(), type); // creates the instance
+ var = CBotVar::Create(vartoken->GetString(), type); // creates the instance
// var->SetClass(pClass);
var->SetUniqNum(
((CBotLeftExprVar*)inst->m_var)->m_nIdent = CBotVar::NextUniqNum());
@@ -536,7 +536,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
pStack->AddVar(var); // placed on the stack
// look if there are parameters
- inst->m_hasParams = (p->GivType() == ID_OPENPAR);
+ inst->m_hasParams = (p->GetType() == ID_OPENPAR);
CBotVar* ppVars[1000];
inst->m_Parameters = CompileParams(p, pStk, ppVars);
@@ -551,9 +551,9 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
{
// the constructor is there?
// CBotString noname;
- CBotTypResult r = pClass->CompileMethode(pClass->GivName(), var, ppVars, pStk, inst->m_nMethodeIdent);
+ CBotTypResult r = pClass->CompileMethode(pClass->GetName(), var, ppVars, pStk, inst->m_nMethodeIdent);
delete pStk->TokenStack(); // releases the supplement stack
- int typ = r.GivType();
+ int typ = r.GetType();
if (typ == TX_UNDEFCALL)
{
@@ -568,7 +568,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
if (typ>20)
{
- pStk->SetError(typ, vartoken->GivEnd());
+ pStk->SetError(typ, vartoken->GetEnd());
goto error;
}
@@ -578,7 +578,7 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
{
if (inst->m_hasParams)
{
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
goto error;
}
@@ -586,15 +586,15 @@ CBotInstr* CBotClassInst::Compile(CBotToken* &p, CBotCStack* pStack, CBotClass*
{
goto error;
}
- CBotClass* result = pStk->GivClass();
- if ( !pStk->GivTypResult(1).Eq(CBotTypNullPointer) &&
- ( !pStk->GivTypResult(1).Eq(CBotTypPointer) ||
+ CBotClass* result = pStk->GetClass();
+ if ( !pStk->GetTypResult(1).Eq(CBotTypNullPointer) &&
+ ( !pStk->GetTypResult(1).Eq(CBotTypPointer) ||
( result != NULL && !pClass->IsChildOf(result) ))) // type compatible ?
{
- pStk->SetError(TX_BADTYPE, p->GivStart());
+ pStk->SetError(TX_BADTYPE, p->GetStart());
goto error;
}
-// if ( !bIntrinsic ) var->SetPointer(pStk->GivVar()->GivPointer());
+// if ( !bIntrinsic ) var->SetPointer(pStk->GetVar()->GetPointer());
if ( !bIntrinsic )
{
// does not use the result on the stack, to impose the class
@@ -630,7 +630,7 @@ suite:
return pStack->Return(inst, pStk);
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
error:
@@ -655,9 +655,9 @@ bool CBotClassInst::Execute(CBotStack* &pj)
// creates the variable of type pointer to the object
- if ( pile->GivState()==0)
+ if ( pile->GetState()==0)
{
- CBotString name = m_var->m_token.GivString();
+ CBotString name = m_var->m_token.GetString();
if ( bIntrincic )
{
pThis = CBotVar::Create(name, CBotTypResult( CBotTypIntrinsic, pClass ));
@@ -674,7 +674,7 @@ bool CBotClassInst::Execute(CBotStack* &pj)
if ( pThis == NULL ) pThis = pile->FindVar(((CBotLeftExprVar*)m_var)->m_nIdent);
- if ( pile->GivState()<3)
+ if ( pile->GetState()<3)
{
// ss there an assignment or parameters (contructor)
@@ -687,18 +687,18 @@ bool CBotClassInst::Execute(CBotStack* &pj)
if ( bIntrincic )
{
- CBotVar* pv = pile->GivVar();
- if ( pv == NULL || pv->GivPointer() == NULL )
+ CBotVar* pv = pile->GetVar();
+ if ( pv == NULL || pv->GetPointer() == NULL )
{
pile->SetError(TX_NULLPT, &m_token);
return pj->Return(pile);
}
- pThis->Copy(pile->GivVar(), false);
+ pThis->Copy(pile->GetVar(), false);
}
else
{
CBotVarClass* pInstance;
- pInstance = ((CBotVarPointer*)pile->GivVar())->GivPointer(); // value for the assignment
+ pInstance = ((CBotVarPointer*)pile->GetVar())->GetPointer(); // value for the assignment
pThis->SetPointer(pInstance);
}
pThis->SetInit(true);
@@ -708,7 +708,7 @@ bool CBotClassInst::Execute(CBotStack* &pj)
{
// evaluates the constructor of an instance
- if ( !bIntrincic && pile->GivState() == 1)
+ if ( !bIntrincic && pile->GetState() == 1)
{
CBotToken* pt = &m_token;
CBotClass* pClass = CBotClass::Find(pt);
@@ -736,13 +736,13 @@ bool CBotClassInst::Execute(CBotStack* &pj)
if ( p != NULL) while ( true )
{
pile2 = pile2->AddStack(); // place on the stack for the results
- if ( pile2->GivState() == 0 )
+ if ( pile2->GetState() == 0 )
{
if (!p->Execute(pile2)) return false; // interrupted here?
pile2->SetState(1);
}
- ppVars[i++] = pile2->GivVar();
- p = p->GivNext();
+ ppVars[i++] = pile2->GetVar();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -750,15 +750,15 @@ bool CBotClassInst::Execute(CBotStack* &pj)
// creates a variable for the result
CBotVar* pResult = NULL; // constructor still void
- if ( !pClass->ExecuteMethode(m_nMethodeIdent, pClass->GivName(),
+ if ( !pClass->ExecuteMethode(m_nMethodeIdent, pClass->GetName(),
pThis, ppVars,
- pResult, pile2, GivToken())) return false; // interrupt
+ pResult, pile2, GetToken())) return false; // interrupt
pThis->SetInit(true);
pThis->ConstructorSet(); // indicates that the constructor has been called
pile->Return(pile2); // releases a piece of stack
-// pInstance = pThis->GivPointer();
+// pInstance = pThis->GetPointer();
}
@@ -787,7 +787,7 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
// creates the variable of type pointer to the object
{
- CBotString name = m_var->m_token.GivString();
+ CBotString name = m_var->m_token.GetString();
pThis = pile->FindVar(name);
pThis->SetUniqNum(((CBotLeftExprVar*)m_var)->m_nIdent); // its attribute a unique number
}
@@ -796,7 +796,7 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
CBotClass* pClass = CBotClass::Find(pt);
bool bIntrincic = pClass->IsIntrinsic();
- if ( bMain && pile->GivState()<3)
+ if ( bMain && pile->GetState()<3)
{
// is there an assignment or parameters (constructor)
@@ -813,7 +813,7 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
{
// evaluates the constructor of an instance
- if ( !bIntrincic && pile->GivState() == 1)
+ if ( !bIntrincic && pile->GetState() == 1)
{
return;
}
@@ -833,13 +833,13 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
pile2 = pile2->RestoreStack(); // place on the stack for the results
if ( pile2 == NULL ) return;
- if ( pile2->GivState() == 0 )
+ if ( pile2->GetState() == 0 )
{
p->RestoreState(pile2, bMain); // interrupted here?
return;
}
- ppVars[i++] = pile2->GivVar();
- p = p->GivNext();
+ ppVars[i++] = pile2->GetVar();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -847,7 +847,7 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
// creates a variable for the result
CBotVar* pResult = NULL; // constructor still void
- pClass->RestoreMethode(m_nMethodeIdent, pClass->GivName(), pThis, ppVars, pile2);
+ pClass->RestoreMethode(m_nMethodeIdent, pClass->GetName(), pThis, ppVars, pile2);
return;
}
}
@@ -861,14 +861,14 @@ void CBotClassInst::RestoreState(CBotStack* &pj, bool bMain)
bool CBotClass::CheckCall(CBotToken* &pToken, CBotDefParam* pParam)
{
- CBotString name = pToken->GivString();
+ CBotString name = pToken->GetString();
if ( CBotCall::CheckCall(name) ) return true;
CBotFunction* pp = m_pMethod;
while ( pp != NULL )
{
- if ( pToken->GivString() == pp->GivName() )
+ if ( pToken->GetString() == pp->GetName() )
{
// are their parameters exactly the same?
if ( pp->CheckParam( pParam ) )
diff --git a/src/CBot/CBotDll.h b/src/CBot/CBotDll.h
index 269ef94..c30125c 100644
--- a/src/CBot/CBotDll.h
+++ b/src/CBot/CBotDll.h
@@ -111,16 +111,16 @@ public:
~CBotTypResult();
- int GivType(int mode = 0) const;
+ int GetType(int mode = 0) const;
// returns type CBotType* as a result
void SetType(int n);
// modifies a type
- CBotClass* GivClass() const;
+ CBotClass* GetClass() const;
// makes the pointer to the class (for CBotTypClass, CBotTypPointer)
- int GivLimite() const;
+ int GetLimite() const;
// returns limit size of table (CBotTypArray)
void SetLimite(int n);
@@ -129,7 +129,7 @@ public:
void SetArray(int* max );
// set limits for a list of dimensions (arrays of arrays)
- CBotTypResult& GivTypElem() const;
+ CBotTypResult& GetTypElem() const;
// returns type of array elements (CBotTypArray)
// rend le type des éléments du tableau (CBotTypArray)
@@ -262,7 +262,7 @@ public:
void Empty();
bool IsEmpty() const;
- int GivLength();
+ int GetLength();
int Find(const char c);
int Find(const char* lpsz);
int ReverseFind(const char c);
@@ -338,7 +338,7 @@ public:
CBotStringArray();
~CBotStringArray();
void SetSize(int nb);
- int GivSize();
+ int GetSize();
void Add(const CBotString& str);
CBotString& operator[](int nIndex);
@@ -388,7 +388,7 @@ public:
// frees the static memory areas
static
- int GivVersion();
+ int GetVersion();
// gives the version of the library CBOT
@@ -406,10 +406,10 @@ public:
void SetIdent(long n);
// associates an identifier with the instance CBotProgram
- long GivIdent();
+ long GetIdent();
// gives the identifier
- int GivError();
+ int GetError();
bool GetError(int& code, int& start, int& end);
bool GetError(int& code, int& start, int& end, CBotProgram* &pProg);
// if true
@@ -417,7 +417,7 @@ public:
// or execution
// delimits the start and end block where the error
// pProg lets you know what "module" has produced runtime error
- static CBotString GivErrorText(int code);
+ static CBotString GetErrorText(int code);
bool Start(const char* name);
@@ -437,7 +437,7 @@ public:
// FunctionName is a pointer made to the name of the function
// start and end position in the text of the token processing
- CBotVar* GivStackVars(const char* &FunctionName, int level);
+ CBotVar* GetStackVars(const char* &FunctionName, int level);
// provides the pointer to the variables on the execution stack
// level is an input parameter, 0 for the last level, -1, -2, etc. for the other levels
// the return value (CBotVar *) is a variable list (or NULL)
@@ -480,7 +480,7 @@ public:
// see the above modes in CBotGet
- CBotFunction* GivFunctions();
+ CBotFunction* GetFunctions();
};
@@ -513,8 +513,8 @@ int cMean(CBotVar* &pVar, CBotString& ClassName)
while ( pVar != NULL )
{
- if ( pVar->GivType() > CBotTypDouble ) return 6002; // this is not a number
- pVar = pVar -> GivNext();
+ if ( pVar->GetType() > CBotTypDouble ) return 6002; // this is not a number
+ pVar = pVar -> GetNext();
}
return CBotTypFloat; // the type of the result may depend on the parameters!
@@ -527,8 +527,8 @@ bool rMean(CBotVar* pVar, CBotVar* pResult, int& Exception)
int nb = 0;
while (pVar != NULL)
{
- total += pVar->GivValFloat();
- pVar = pVar->GivNext();
+ total += pVar->GetValFloat();
+ pVar = pVar->GetNext();
nb++;
}
pResult->SetValFloat(total/nb); // returns the mean value
@@ -544,7 +544,7 @@ bool rMean(CBotVar* pVar, CBotVar* pResult, int& Exception)
// may be useful to the outside of the module
// ( it is currently not expected to be able to create these objects in outer )
-// results of GivInit()
+// results of GetInit()
#define IS_UNDEF 0 // undefined variable
#define IS_DEF 1 // variable defined
#define IS_NAN 999 // variable defined as not a number
@@ -615,33 +615,33 @@ virtual ~CBotVar( ); // destructor
// associates a unique identifier to an instance
// ( it is used to ensure that the id is unique)
- void* GivUserPtr();
+ void* GetUserPtr();
// makes the pointer associated with the variable
- CBotString GivName(); // the name of the variable, if known
+ CBotString GetName(); // the name of the variable, if known
////////////////////////////////////////////////////////////////////////////////////
void SetName(const char* name); // changes the name of the variable
- int GivType(int mode = 0); // returns the base type (int) of the variable
+ int GetType(int mode = 0); // returns the base type (int) of the variable
// TODO check it
////////////////////////////////////////////////////////////////////////////////////////
- CBotTypResult GivTypResult(int mode = 0); // returns the complete type of the variable
+ CBotTypResult GetTypResult(int mode = 0); // returns the complete type of the variable
- CBotToken* GivToken();
+ CBotToken* GetToken();
void SetType(CBotTypResult& type);
void SetInit(int bInit); // is the variable in the state IS_UNDEF, IS_DEF, IS_NAN
- int GivInit(); // gives the state of the variable
+ int GetInit(); // gives the state of the variable
void SetStatic(bool bStatic);
bool IsStatic();
void SetPrivate(int mPrivate);
bool IsPrivate(int mode = PR_PROTECT);
- int GivPrivate();
+ int GetPrivate();
virtual
void ConstructorSet();
@@ -649,23 +649,23 @@ virtual ~CBotVar( ); // destructor
void SetVal(CBotVar* var); // remprend une valeur
// TODO remprend value
virtual
- CBotVar* GivItem(const char* name); // returns an element of a class according to its name (*)
+ CBotVar* GetItem(const char* name); // returns an element of a class according to its name (*)
virtual
- CBotVar* GivItemRef(int nIdent); // idem à partir du n° ref
+ CBotVar* GetItemRef(int nIdent); // idem à partir du n° ref
// TODO ditto from ref no.
virtual
- CBotVar* GivItem(int row, bool bGrow = false);
+ CBotVar* GetItem(int row, bool bGrow = false);
virtual
- CBotVar* GivItemList(); // lists the elements
+ CBotVar* GetItemList(); // lists the elements
- CBotVar* GivStaticVar(); // makes the pointer to the variable if it is static
+ CBotVar* GetStaticVar(); // makes the pointer to the variable if it is static
bool IsElemOfClass(const char* name);
// said if the element belongs to the class "name"
// makes true if the object is a subclass
- CBotVar* GivNext(); // next variable in the list (parameters)
+ CBotVar* GetNext(); // next variable in the list (parameters)
////////////////////////////////////////////////////////////////////////////////////////////
void AddNext(CBotVar* pVar); // added to a list
@@ -683,23 +683,23 @@ virtual ~CBotVar( ); // destructor
virtual void SetValString(const char* p);// initialized with a string value (#)
////////////////////////////////////////////////////////////////////////////////
- virtual int GivValInt(); // request the full value (#)
+ virtual int GetValInt(); // request the full value (#)
////////////////////////////////////////////////////////////////////////
- virtual float GivValFloat(); // gets real value (#)
+ virtual float GetValFloat(); // gets real value (#)
///////////////////////////////////////////////////////////////////////
virtual
- CBotString GivValString(); // request the string value (#)
+ CBotString GetValString(); // request the string value (#)
///////////////////////////////////////////////////////////////////////
virtual void SetClass(CBotClass* pClass);
virtual
- CBotClass* GivClass();
+ CBotClass* GetClass();
virtual void SetPointer(CBotVar* p);
virtual
- CBotVarClass* GivPointer();
+ CBotVarClass* GetPointer();
// virtual void SetIndirection(CBotVar* pVar);
virtual void Add(CBotVar* left, CBotVar* right); // addition
@@ -736,13 +736,13 @@ virtual ~CBotVar( ); // destructor
void debug();
// virtual
-// CBotVar* GivMyThis();
+// CBotVar* GetMyThis();
virtual
void Maj(void* pUser = NULL, bool bContinue = true);
void SetUniqNum(long n);
- long GivUniqNum();
+ long GetUniqNum();
static long NextUniqNum();
};
@@ -751,12 +751,12 @@ virtual ~CBotVar( ); // destructor
can be called with objects which are respectively integer, real or string
Always be sure of the type of the variable before calling these methods
- if ( pVar->GivType() == CBotInt() ) pVar->SetValFloat( 3.3 ); // plante !!
+ if ( pVar->GetType() == CBotInt() ) pVar->SetValFloat( 3.3 ); // plante !!
- methods GivValInt(), GivValFloat() et GivValString()
+ methods GetValInt(), GetValFloat() et GetValString()
use value conversions,
- GivValString() works on numbers (makes the corresponding string)
- but do not make GivValInt () with a string variable!
+ GetValString() works on numbers (makes the corresponding string)
+ but do not make GetValInt () with a string variable!
*/
@@ -824,8 +824,8 @@ public:
// adds an element by giving an element of type CBotVar
void AddNext(CBotClass* pClass);
- CBotString GivName(); // gives the name of the class
- CBotClass* GivParent(); // gives the parent class (or NULL)
+ CBotString GetName(); // gives the name of the class
+ CBotClass* GetParent(); // gives the parent class (or NULL)
// true if a class is derived (Extends) of another
// return true also if the classes are identical
@@ -837,9 +837,9 @@ public:
static
CBotClass* Find(const char* name);
- CBotVar* GivVar(); // return the list of variables
- CBotVar* GivItem(const char* name); // one of the variables according to its name
- CBotVar* GivItemRef(int nIdent);
+ CBotVar* GetVar(); // return the list of variables
+ CBotVar* GetItem(const char* name); // one of the variables according to its name
+ CBotVar* GetItemRef(int nIdent);
CBotTypResult CompileMethode(const char* name, CBotVar* pThis, CBotVar** ppParams,
CBotCStack* pStack, long& nIdent);
@@ -922,9 +922,9 @@ private:
* \brief Check whether given parameter is a keyword
*/
static
- int GivKeyWords(const char* w); // is it a keyword?
+ int GetKeyWords(const char* w); // is it a keyword?
static
- bool GivKeyDefNum(const char* w, CBotToken* &token);
+ bool GetKeyDefNum(const char* w, CBotToken* &token);
/**
* \brief Loads the list of keywords
@@ -948,35 +948,35 @@ public:
/**
* \brief Returns the type of token
*/
- int GivType();
+ int GetType();
/**
* \brief makes the string corresponding to this token
*/
- CBotString& GivString();
+ CBotString& GetString();
/**
* \brief makes the following separator token
*/
- CBotString& GivSep();
+ CBotString& GetSep();
/**
* \brief position of the beginning in the text
*/
- int GivStart();
+ int GetStart();
/**
* \brief end position in the text
*/
- int GivEnd();
+ int GetEnd();
/**
* \brief gives the next token in the list
*/
- CBotToken* GivNext();
+ CBotToken* GetNext();
/**
* \brief gives the previous token in a list
*/
- CBotToken* GivPrev();
+ CBotToken* GetPrev();
/**
* \brief transforms the entire program
@@ -997,7 +997,7 @@ public:
void SetString(const char* name);
void SetPos(int start, int end);
- long GivIdKey();
+ long GetIdKey();
/**
* \brief adds a token (a copy)
*/
@@ -1091,7 +1091,7 @@ public:
// routine that implements the GOTO (CPoint pos)
bool rDoGoto( CBotVar* pVar, CBotVar* pResult, int& exception )
{
- if (pVar->GivType() != CBotTypeClass ||
+ if (pVar->GetType() != CBotTypeClass ||
pVar->IsElemOfClas("CPoint") ) { exception = 6522; return false; )
// the parameter is not the right class?
// in fact the control is done to the routine of compilation
@@ -1100,13 +1100,13 @@ bool rDoGoto( CBotVar* pVar, CBotVar* pResult, int& exception )
// or so
CBotVar* temp;
- temp = pVar->GivItem("x"); // is necessary for the object of type CPoint
- ASSERT (temp != NULL && temp->GivType() == CBotTypFloat);
- m_PosToGo.x = temp->GivValFloat();
+ temp = pVar->GetItem("x"); // is necessary for the object of type CPoint
+ ASSERT (temp != NULL && temp->GetType() == CBotTypFloat);
+ m_PosToGo.x = temp->GetValFloat();
- temp = pVar->GivItem("y"); // is necessary for the object of type CPoint
- ASSERT (temp != NULL && temp->GivType() == CBotTypFloat);
- m_PosToGo.y = temp->GivValFloat();
+ temp = pVar->GetItem("y"); // is necessary for the object of type CPoint
+ ASSERT (temp != NULL && temp->GetType() == CBotTypFloat);
+ m_PosToGo.y = temp->GetValFloat();
return (m_CurentPos == m_PosToGo); // makes true if the position is reached
// returns false if one had wait yet
diff --git a/src/CBot/CBotFunction.cpp b/src/CBot/CBotFunction.cpp
index 1c94c1b..3b0496e 100644
--- a/src/CBot/CBotFunction.cpp
+++ b/src/CBot/CBotFunction.cpp
@@ -77,40 +77,40 @@ bool CBotFunction::IsExtern()
bool CBotFunction::GetPosition(int& start, int& stop, CBotGet modestart, CBotGet modestop)
{
- start = m_extern.GivStart();
- stop = m_closeblk.GivEnd();
+ start = m_extern.GetStart();
+ stop = m_closeblk.GetEnd();
if (modestart == GetPosExtern)
{
- start = m_extern.GivStart();
+ start = m_extern.GetStart();
}
if (modestop == GetPosExtern)
{
- stop = m_extern.GivEnd();
+ stop = m_extern.GetEnd();
}
if (modestart == GetPosNom)
{
- start = m_token.GivStart();
+ start = m_token.GetStart();
}
if (modestop == GetPosNom)
{
- stop = m_token.GivEnd();
+ stop = m_token.GetEnd();
}
if (modestart == GetPosParam)
{
- start = m_openpar.GivStart();
+ start = m_openpar.GetStart();
}
if (modestop == GetPosParam)
{
- stop = m_closepar.GivEnd();
+ stop = m_closepar.GetEnd();
}
if (modestart == GetPosBloc)
{
- start = m_openblk.GivStart();
+ start = m_openblk.GetStart();
}
if (modestop == GetPosBloc)
{
- stop = m_closeblk.GivEnd();
+ stop = m_closeblk.GetEnd();
}
return true;
@@ -123,7 +123,7 @@ CBotTypResult ArrayType(CBotToken* &p, CBotCStack* pile, CBotTypResult type)
{
if ( !IsOfType( p, ID_CLBRK ) )
{
- pile->SetError(TX_CLBRK, p->GivStart());
+ pile->SetError(TX_CLBRK, p->GetStart());
return CBotTypResult( -1 );
}
type = CBotTypResult( CBotTypArrayPointer, type );
@@ -135,30 +135,30 @@ CBotTypResult TypeParam(CBotToken* &p, CBotCStack* pile)
{
CBotClass* pClass = NULL;
- switch (p->GivType())
+ switch (p->GetType())
{
case ID_INT:
- p = p->GivNext();
+ p = p->GetNext();
return ArrayType(p, pile, CBotTypResult( CBotTypInt ));
case ID_FLOAT:
- p = p->GivNext();
+ p = p->GetNext();
return ArrayType(p, pile, CBotTypResult( CBotTypFloat ));
case ID_BOOLEAN:
case ID_BOOL:
- p = p->GivNext();
+ p = p->GetNext();
return ArrayType(p, pile, CBotTypResult( CBotTypBoolean ));
case ID_STRING:
- p = p->GivNext();
+ p = p->GetNext();
return ArrayType(p, pile, CBotTypResult( CBotTypString ));
case ID_VOID:
- p = p->GivNext();
+ p = p->GetNext();
return CBotTypResult( 0 );
case TokenTypVar:
pClass = CBotClass::Find(p);
if ( pClass != NULL)
{
- p = p->GivNext();
+ p = p->GetNext();
return ArrayType(p, pile,
pClass->IsIntrinsic() ?
CBotTypResult( CBotTypIntrinsic, pClass ) :
@@ -203,14 +203,14 @@ CBotFunction* CBotFunction::Compile(CBotToken* &p, CBotCStack* pStack, CBotFunct
// CBotClass* pClass;
func->m_retTyp = TypeParam(p, pStk); // type of the result
- if (func->m_retTyp.GivType() >= 0)
+ if (func->m_retTyp.GetType() >= 0)
{
CBotToken* pp = p;
func->m_token = *p;
if ( IsOfType(p, ID_NOT) )
{
- CBotToken d("~" + p->GivString());
+ CBotToken d("~" + p->GetString());
func->m_token = d;
}
@@ -219,7 +219,7 @@ CBotFunction* CBotFunction::Compile(CBotToken* &p, CBotCStack* pStack, CBotFunct
{
if ( IsOfType( p, ID_DBLDOTS ) ) // method for a class
{
- func->m_MasterClass = pp->GivString();
+ func->m_MasterClass = pp->GetString();
CBotClass* pClass = CBotClass::Find(pp);
if ( pClass == NULL ) goto bad;
@@ -230,7 +230,7 @@ CBotFunction* CBotFunction::Compile(CBotToken* &p, CBotCStack* pStack, CBotFunct
}
func->m_openpar = p;
func->m_Param = CBotDefParam::Compile( p, pStk );
- func->m_closepar = p->GivPrev();
+ func->m_closepar = p->GetPrev();
if (pStk->IsOk())
{
pStk->SetRetType(func->m_retTyp); // for knowledge what type returns
@@ -247,24 +247,24 @@ CBotFunction* CBotFunction::Compile(CBotToken* &p, CBotCStack* pStack, CBotFunct
// initialize variables acording to This
// only saves the pointer to the first,
// the rest is chained
- CBotVar* pv = pThis->GivItemList();
+ CBotVar* pv = pThis->GetItemList();
// int num = 1;
while (pv != NULL)
{
CBotVar* pcopy = CBotVar::Create(pv);
// pcopy->SetInit(2);
pcopy->Copy(pv);
- pcopy->SetPrivate(pv->GivPrivate());
-// pcopy->SetUniqNum(pv->GivUniqNum()); //num++);
+ pcopy->SetPrivate(pv->GetPrivate());
+// pcopy->SetUniqNum(pv->GetUniqNum()); //num++);
pStk->AddVar(pcopy);
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
}
// and compiles the following instruction block
func->m_openblk = p;
func->m_Block = CBotBlock::Compile(p, pStk, false);
- func->m_closeblk = p->GivPrev();
+ func->m_closeblk = p->GetPrev();
if ( pStk->IsOk() )
{
if ( func->m_bPublic ) // public function, return known for all
@@ -309,7 +309,7 @@ CBotFunction* CBotFunction::Compile1(CBotToken* &p, CBotCStack* pStack, CBotClas
func->m_retToken = *p;
func->m_retTyp = TypeParam(p, pStack); // type of the result
- if (func->m_retTyp.GivType() >= 0)
+ if (func->m_retTyp.GetType() >= 0)
{
CBotToken* pp = p;
func->m_token = *p;
@@ -318,7 +318,7 @@ CBotFunction* CBotFunction::Compile1(CBotToken* &p, CBotCStack* pStack, CBotClas
{
if ( IsOfType( p, ID_DBLDOTS ) ) // method for a class
{
- func->m_MasterClass = pp->GivString();
+ func->m_MasterClass = pp->GetString();
CBotClass* pClass = CBotClass::Find(pp);
if ( pClass == NULL )
{
@@ -344,8 +344,8 @@ CBotFunction* CBotFunction::Compile1(CBotToken* &p, CBotCStack* pStack, CBotClas
// and skips the following instruction block
do
{
- int type = p->GivType();
- p = p->GivNext();
+ int type = p->GetType();
+ p = p->GetNext();
if (type == ID_OPBLK) level++;
if (type == ID_CLBLK) level--;
}
@@ -377,13 +377,13 @@ bool CBotFunction::Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance)
pile->SetBotCall(m_pProg); // bases for routines
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
if ( !m_Param->Execute(ppVars, pile) ) return false; // define parameters
pile->IncState();
}
- if ( pile->GivState() == 1 && !m_MasterClass.IsEmpty() )
+ if ( pile->GetState() == 1 && !m_MasterClass.IsEmpty() )
{
// makes "this" known
CBotVar* pThis ;
@@ -410,7 +410,7 @@ bool CBotFunction::Execute(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInstance)
if ( !m_Block->Execute(pile) )
{
- if ( pile->GivError() < 0 )
+ if ( pile->GetError() < 0 )
pile->SetError( 0 );
else
return false;
@@ -428,11 +428,11 @@ void CBotFunction::RestoreState(CBotVar** ppVars, CBotStack* &pj, CBotVar* pInst
pile->SetBotCall(m_pProg); // bases for routines
- if ( pile->GivBlock() < 2 )
+ if ( pile->GetBlock() < 2 )
{
CBotStack* pile2 = pile->RestoreStack(NULL); // one end of stack local to this function
if ( pile2 == NULL ) return;
- pile->SetState(pile->GivState() + pile2->GivState());
+ pile->SetState(pile->GetState() + pile2->GetState());
pile2->Delete();
}
@@ -507,7 +507,7 @@ CBotFunction* CBotFunction::FindLocalOrPublic(long& nIdent, const char* name, CB
{
for ( pt = this ; pt != NULL ; pt = pt->m_next )
{
- if ( pt->m_token.GivString() == name )
+ if ( pt->m_token.GetString() == name )
{
int i = 0;
int alpha = 0; // signature of parameters
@@ -516,15 +516,15 @@ CBotFunction* CBotFunction::FindLocalOrPublic(long& nIdent, const char* name, CB
CBotVar* pw = ppVars[i++]; // provided list parameter
while ( pv != NULL && pw != NULL)
{
- if (!TypesCompatibles(pv->GivTypResult(), pw->GivTypResult()))
+ if (!TypesCompatibles(pv->GetTypResult(), pw->GetTypResult()))
{
if ( pFunc == NULL ) TypeOrError = TX_BADPARAM;
break;
}
- int d = pv->GivType() - pw->GivType(2);
+ int d = pv->GetType() - pw->GetType(2);
alpha += d>0 ? d : -10*d; // quality loss, 10 times more expensive!
- pv = pv->GivNext();
+ pv = pv->GetNext();
pw = ppVars[i++];
}
if ( pw != NULL )
@@ -562,7 +562,7 @@ CBotFunction* CBotFunction::FindLocalOrPublic(long& nIdent, const char* name, CB
{
for ( pt = m_listPublic ; pt != NULL ; pt = pt->m_nextpublic )
{
- if ( pt->m_token.GivString() == name )
+ if ( pt->m_token.GetString() == name )
{
int i = 0;
int alpha = 0; // signature of parameters
@@ -571,15 +571,15 @@ CBotFunction* CBotFunction::FindLocalOrPublic(long& nIdent, const char* name, CB
CBotVar* pw = ppVars[i++]; // list of provided parameters
while ( pv != NULL && pw != NULL)
{
- if (!TypesCompatibles(pv->GivTypResult(), pw->GivTypResult()))
+ if (!TypesCompatibles(pv->GetTypResult(), pw->GetTypResult()))
{
if ( pFunc == NULL ) TypeOrError = TX_BADPARAM;
break;
}
- int d = pv->GivType() - pw->GivType(2);
+ int d = pv->GetType() - pw->GetType(2);
alpha += d>0 ? d : -10*d; // quality loss, 10 times more expensive!
- pv = pv->GivNext();
+ pv = pv->GetNext();
pw = ppVars[i++];
}
if ( pw != NULL )
@@ -645,7 +645,7 @@ int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar** ppVars, CBotS
// preparing parameters on the stack
- if ( pStk1->GivState() == 0 )
+ if ( pStk1->GetState() == 0 )
{
if ( !pt->m_MasterClass.IsEmpty() )
{
@@ -677,13 +677,13 @@ int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar** ppVars, CBotS
// finally execution of the found function
- if ( !pStk3->GivRetVar( // puts the result on the stack
- pt->m_Block->Execute(pStk3) )) // GivRetVar said if it is interrupted
+ if ( !pStk3->GetRetVar( // puts the result on the stack
+ pt->m_Block->Execute(pStk3) )) // GetRetVar said if it is interrupted
{
if ( !pStk3->IsOk() && pt->m_pProg != m_pProg )
{
#ifdef _DEBUG
- if ( m_pProg->GivFunctions()->GivName() == "LaCommande" ) return false;
+ if ( m_pProg->GetFunctions()->GetName() == "LaCommande" ) return false;
#endif
pStk3->SetPosError(pToken); // indicates the error on the procedure call
}
@@ -713,7 +713,7 @@ void CBotFunction::RestoreCall(long& nIdent, const char* name, CBotVar** ppVars,
pStk1->SetBotCall(pt->m_pProg); // it may have changed module
- if ( pStk1->GivBlock() < 2 )
+ if ( pStk1->GetBlock() < 2 )
{
CBotStack* pStk2 = pStk1->RestoreStack(NULL); // used more
if ( pStk2 == NULL ) return;
@@ -739,7 +739,7 @@ void CBotFunction::RestoreCall(long& nIdent, const char* name, CBotVar** ppVars,
}
}
- if ( pStk1->GivState() == 0 )
+ if ( pStk1->GetState() == 0 )
{
pt->m_Param->RestoreState(pStk3, true);
return;
@@ -759,13 +759,13 @@ void CBotFunction::RestoreCall(long& nIdent, const char* name, CBotVar** ppVars,
int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppVars, CBotStack* pStack, CBotToken* pToken, CBotClass* pClass)
{
CBotTypResult type;
- CBotProgram* pProgCurrent = pStack->GivBotCall();
+ CBotProgram* pProgCurrent = pStack->GetBotCall();
CBotFunction* pt = FindLocalOrPublic(nIdent, name, ppVars, type, false);
if ( pt != NULL )
{
-// DEBUG( "CBotFunction::DoCall" + pt->GivName(), 0, pStack);
+// DEBUG( "CBotFunction::DoCall" + pt->GetName(), 0, pStack);
CBotStack* pStk = pStack->AddStack(pt, 2);
// if ( pStk == EOX ) return true;
@@ -775,7 +775,7 @@ int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar
// preparing parameters on the stack
- if ( pStk->GivState() == 0 )
+ if ( pStk->GetState() == 0 )
{
// sets the variable "this" on the stack
CBotVar* pthis = CBotVar::Create("this", CBotTypNullPointer);
@@ -783,7 +783,7 @@ int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar
pthis->SetUniqNum(-2); // special value
pStk->AddVar(pthis);
- CBotClass* pClass = pThis->GivClass()->GivParent();
+ CBotClass* pClass = pThis->GetClass()->GetParent();
if ( pClass )
{
// sets the variable "super" on the stack
@@ -797,19 +797,19 @@ int CBotFunction::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBotVar
pStk->IncState();
}
- if ( pStk->GivState() == 1 )
+ if ( pStk->GetState() == 1 )
{
if ( pt->m_bSynchro )
{
- CBotProgram* pProgBase = pStk->GivBotCall(true);
+ CBotProgram* pProgBase = pStk->GetBotCall(true);
if ( !pClass->Lock(pProgBase) ) return false; // expected to power \TODO attend de pouvoir
}
pStk->IncState();
}
// finally calls the found function
- if ( !pStk3->GivRetVar( // puts the result on the stack
- pt->m_Block->Execute(pStk3) )) // GivRetVar said if it is interrupted
+ if ( !pStk3->GetRetVar( // puts the result on the stack
+ pt->m_Block->Execute(pStk3) )) // GetRetVar said if it is interrupted
{
if ( !pStk3->IsOk() )
{
@@ -855,10 +855,10 @@ void CBotFunction::RestoreCall(long& nIdent, const char* name, CBotVar* pThis, C
pt->m_Param->RestoreState(pStk3, true); // parameters
- if ( pStk->GivState() > 1 && // latching is effective?
+ if ( pStk->GetState() > 1 && // latching is effective?
pt->m_bSynchro )
{
- CBotProgram* pProgBase = pStk->GivBotCall(true);
+ CBotProgram* pProgBase = pStk->GetBotCall(true);
pClass->Lock(pProgBase); // locks the class
}
@@ -874,21 +874,21 @@ bool CBotFunction::CheckParam(CBotDefParam* pParam)
CBotDefParam* pp = m_Param;
while ( pp != NULL && pParam != NULL )
{
- CBotTypResult type1 = pp->GivType();
- CBotTypResult type2 = pParam->GivType();
+ CBotTypResult type1 = pp->GetType();
+ CBotTypResult type2 = pParam->GetType();
if ( !type1.Compare(type2) ) return false;
- pp = pp->GivNext();
- pParam = pParam->GivNext();
+ pp = pp->GetNext();
+ pParam = pParam->GetNext();
}
return ( pp == NULL && pParam == NULL );
}
-CBotString CBotFunction::GivName()
+CBotString CBotFunction::GetName()
{
- return m_token.GivString();
+ return m_token.GetString();
}
-CBotString CBotFunction::GivParams()
+CBotString CBotFunction::GetParams()
{
if ( m_Param == NULL ) return CBotString("()");
@@ -897,8 +897,8 @@ CBotString CBotFunction::GivParams()
while (p != NULL)
{
- params += p->GivParamString();
- p = p->GivNext();
+ params += p->GetParamString();
+ p = p->GetNext();
if ( p != NULL ) params += ", ";
}
@@ -945,7 +945,7 @@ CBotDefParam* CBotDefParam::Compile(CBotToken* &p, CBotCStack* pStack)
// mainly not pStack->TokenStack here
// declared variables must remain visible thereafter
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
if (IsOfType(p, ID_OPENPAR))
{
@@ -958,11 +958,11 @@ CBotDefParam* CBotDefParam::Compile(CBotToken* &p, CBotCStack* pStack)
else list->AddNext(param); // added to the list
CBotClass* pClass = NULL;//= CBotClass::Find(p);
- param->m_typename = p->GivString();
+ param->m_typename = p->GetString();
CBotTypResult type = param->m_type = TypeParam(p, pStack);
// if ( type == CBotTypPointer ) type = CBotTypClass; // we must create a new object
- if (param->m_type.GivType() > 0)
+ if (param->m_type.GetType() > 0)
{
CBotToken* pp = p;
param->m_token = *p;
@@ -977,17 +977,17 @@ CBotDefParam* CBotDefParam::Compile(CBotToken* &p, CBotCStack* pStack)
}
if ( type.Eq(CBotTypArrayPointer) ) type.SetType(CBotTypArrayBody);
- CBotVar* var = CBotVar::Create(pp->GivString(), type); // creates the variable
+ CBotVar* var = CBotVar::Create(pp->GetString(), type); // creates the variable
// if ( pClass ) var->SetClass(pClass);
var->SetInit(2); // mark initialized
param->m_nIdent = CBotVar::NextUniqNum();
var->SetUniqNum(param->m_nIdent);
pStack->AddVar(var); // place on the stack
- if (IsOfType(p, ID_COMMA) || p->GivType() == ID_CLOSEPAR)
+ if (IsOfType(p, ID_COMMA) || p->GetType() == ID_CLOSEPAR)
continue;
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
}
pStack->SetError(TX_NOTYP, p);
delete list;
@@ -995,7 +995,7 @@ CBotDefParam* CBotDefParam::Compile(CBotToken* &p, CBotCStack* pStack)
}
return list;
}
- pStack->SetError(TX_OPENPAR, p->GivStart());
+ pStack->SetError(TX_OPENPAR, p->GetStart());
return NULL;
}
@@ -1016,24 +1016,24 @@ bool CBotDefParam::Execute(CBotVar** ppVars, CBotStack* &pj)
while ( p != NULL )
{
// creates a local variable on the stack
- CBotVar* newvar = CBotVar::Create(p->m_token.GivString(), p->m_type);
+ CBotVar* newvar = CBotVar::Create(p->m_token.GetString(), p->m_type);
// serves to make the transformation of types:
if ( ppVars != NULL && ppVars[i] != NULL )
{
- switch (p->m_type.GivType())
+ switch (p->m_type.GetType())
{
case CBotTypInt:
- newvar->SetValInt(ppVars[i]->GivValInt());
+ newvar->SetValInt(ppVars[i]->GetValInt());
break;
case CBotTypFloat:
- newvar->SetValFloat(ppVars[i]->GivValFloat());
+ newvar->SetValFloat(ppVars[i]->GetValFloat());
break;
case CBotTypString:
- newvar->SetValString(ppVars[i]->GivValString());
+ newvar->SetValString(ppVars[i]->GetValString());
break;
case CBotTypBoolean:
- newvar->SetValInt(ppVars[i]->GivValInt());
+ newvar->SetValInt(ppVars[i]->GetValInt());
break;
case CBotTypIntrinsic:
((CBotVarClass*)newvar)->Copy(ppVars[i], false);
@@ -1041,7 +1041,7 @@ bool CBotDefParam::Execute(CBotVar** ppVars, CBotStack* &pj)
case CBotTypPointer:
case CBotTypArrayPointer:
{
- newvar->SetPointer(ppVars[i]->GivPointer());
+ newvar->SetPointer(ppVars[i]->GetPointer());
}
break;
default:
@@ -1065,35 +1065,35 @@ void CBotDefParam::RestoreState(CBotStack* &pj, bool bMain)
while ( p != NULL )
{
// creates a local variable on the stack
- CBotVar* var = pj->FindVar(p->m_token.GivString());
+ CBotVar* var = pj->FindVar(p->m_token.GetString());
var->SetUniqNum(p->m_nIdent);
p = p->m_next;
}
}
-int CBotDefParam::GivType()
+int CBotDefParam::GetType()
{
- return m_type.GivType();
+ return m_type.GetType();
}
-CBotTypResult CBotDefParam::GivTypResult()
+CBotTypResult CBotDefParam::GetTypResult()
{
return m_type;
}
-CBotDefParam* CBotDefParam::GivNext()
+CBotDefParam* CBotDefParam::GetNext()
{
return m_next;
}
-CBotString CBotDefParam::GivParamString()
+CBotString CBotDefParam::GetParamString()
{
CBotString param;
param = m_typename;
param += ' ';
- param += m_token.GivString();
+ param += m_token.GetString();
return param;
}
@@ -1122,9 +1122,9 @@ CBotInstr* CBotReturn::Compile(CBotToken* &p, CBotCStack* pStack)
CBotReturn* inst = new CBotReturn(); // creates the object
inst->SetToken( pp );
- CBotTypResult type = pStack->GivRetType();
+ CBotTypResult type = pStack->GetRetType();
- if ( type.GivType() == 0 ) // returned void ?
+ if ( type.GetType() == 0 ) // returned void ?
{
if ( IsOfType( p, ID_SEP ) ) return inst;
pStack->SetError( TX_BADTYPE, pp );
@@ -1134,15 +1134,15 @@ CBotInstr* CBotReturn::Compile(CBotToken* &p, CBotCStack* pStack)
inst->m_Instr = CBotExpression::Compile(p, pStack);
if ( pStack->IsOk() )
{
- CBotTypResult retType = pStack->GivTypResult(2);
+ CBotTypResult retType = pStack->GetTypResult(2);
if (TypeCompatible(retType, type, ID_ASS))
{
if ( IsOfType( p, ID_SEP ) )
return inst;
- pStack->SetError(TX_ENDOF, p->GivStart());
+ pStack->SetError(TX_ENDOF, p->GetStart());
}
- pStack->SetError(TX_BADTYPE, p->GivStart());
+ pStack->SetError(TX_BADTYPE, p->GetStart());
}
delete inst;
@@ -1154,7 +1154,7 @@ bool CBotReturn::Execute(CBotStack* &pj)
CBotStack* pile = pj->AddStack(this);
// if ( pile == EOX ) return true;
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
if ( m_Instr != NULL && !m_Instr->Execute(pile) ) return false; // evaluate the result
// the result is on the stack
@@ -1173,7 +1173,7 @@ void CBotReturn::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this);
if ( pile == NULL ) return;
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
if ( m_Instr != NULL ) m_Instr->RestoreState(pile, bMain); // evaluate the result
return;
@@ -1202,9 +1202,9 @@ CBotInstr* CBotInstrCall::Compile(CBotToken* &p, CBotCStack* pStack)
int i = 0;
CBotToken* pp = p;
- p = p->GivNext();
+ p = p->GetNext();
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
CBotCStack* pile = pStack;
if ( IsOfType(p, ID_OPENPAR) )
@@ -1216,11 +1216,11 @@ CBotInstr* CBotInstrCall::Compile(CBotToken* &p, CBotCStack* pStack)
// compile la list of parameters
if (!IsOfType(p, ID_CLOSEPAR)) while (true)
{
- start = p->GivStart();
+ start = p->GetStart();
pile = pile->TokenStack(); // keeps the results on the stack
CBotInstr* param = CBotExpression::Compile(p, pile);
- end = p->GivStart();
+ end = p->GetStart();
if ( inst->m_Parameters == NULL ) inst->m_Parameters = param;
else inst->m_Parameters->AddNext(param); // constructs the list
@@ -1232,22 +1232,22 @@ CBotInstr* CBotInstrCall::Compile(CBotToken* &p, CBotCStack* pStack)
if ( param != NULL )
{
- if ( pile->GivTypResult().Eq(99) )
+ if ( pile->GetTypResult().Eq(99) )
{
delete pStack->TokenStack();
- pStack->SetError(TX_VOID, p->GivStart());
+ pStack->SetError(TX_VOID, p->GetStart());
delete inst;
return NULL;
}
- ppVars[i] = pile->GivVar();
- ppVars[i]->GivToken()->SetPos(start, end);
+ ppVars[i] = pile->GetVar();
+ ppVars[i]->GetToken()->SetPos(start, end);
i++;
if (IsOfType(p, ID_COMMA)) continue; // skips the comma
if (IsOfType(p, ID_CLOSEPAR)) break;
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
delete pStack->TokenStack();
delete inst;
return NULL;
@@ -1257,17 +1257,17 @@ CBotInstr* CBotInstrCall::Compile(CBotToken* &p, CBotCStack* pStack)
// the routine is known?
// CBotClass* pClass = NULL;
inst->m_typRes = pStack->CompileCall(pp, ppVars, inst->m_nFuncIdent);
- if ( inst->m_typRes.GivType() >= 20 )
+ if ( inst->m_typRes.GetType() >= 20 )
{
// if (pVar2!=NULL) pp = pVar2->RetToken();
- pStack->SetError( inst->m_typRes.GivType(), pp );
+ pStack->SetError( inst->m_typRes.GetType(), pp );
delete pStack->TokenStack();
delete inst;
return NULL;
}
delete pStack->TokenStack();
- if ( inst->m_typRes.GivType() > 0 )
+ if ( inst->m_typRes.GetType() > 0 )
{
CBotVar* pRes = CBotVar::Create("", inst->m_typRes);
pStack->SetVar(pRes); // for knowing the type of the result
@@ -1298,13 +1298,13 @@ bool CBotInstrCall::Execute(CBotStack* &pj)
if ( p != NULL) while ( true )
{
pile = pile->AddStack(); // place on the stack for the results
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
if (!p->Execute(pile)) return false; // interrupted here?
pile->SetState(1); // mark as special for reknowed parameters \TODO marque spéciale pour reconnaîre parameters
}
- ppVars[i++] = pile->GivVar();
- p = p->GivNext();
+ ppVars[i++] = pile->GetVar();
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -1312,7 +1312,7 @@ bool CBotInstrCall::Execute(CBotStack* &pj)
CBotStack* pile2 = pile->AddStack();
if ( pile2->IfStep() ) return false;
- if ( !pile2->ExecuteCall(m_nFuncIdent, GivToken(), ppVars, m_typRes)) return false; // interrupt
+ if ( !pile2->ExecuteCall(m_nFuncIdent, GetToken(), ppVars, m_typRes)) return false; // interrupt
return pj->Return(pile2); // release the entire stack
}
@@ -1336,13 +1336,13 @@ void CBotInstrCall::RestoreState(CBotStack* &pj, bool bMain)
{
pile = pile->RestoreStack(); // place on the stack for the results
if ( pile == NULL ) return;
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
p->RestoreState(pile, bMain); // interrupt here!
return;
}
- ppVars[i++] = pile->GivVar(); // constructs the list of parameters
- p = p->GivNext();
+ ppVars[i++] = pile->GetVar(); // constructs the list of parameters
+ p = p->GetNext();
if ( p == NULL) break;
}
ppVars[i] = NULL;
@@ -1350,7 +1350,7 @@ void CBotInstrCall::RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile2 = pile->RestoreStack();
if ( pile2 == NULL ) return;
- pile2->RestoreCall(m_nFuncIdent, GivToken(), ppVars);
+ pile2->RestoreCall(m_nFuncIdent, GetToken(), ppVars);
}
//////////////////////////////////////////////////////////////////////////////
@@ -1369,7 +1369,7 @@ CBotClass* CBotClass::Compile1(CBotToken* &p, CBotCStack* pStack)
if ( !IsOfType(p, ID_CLASS) ) return NULL;
- CBotString name = p->GivString();
+ CBotString name = p->GetString();
CBotClass* pOld = CBotClass::Find(name);
if ( pOld != NULL && pOld->m_IsDef )
@@ -1384,7 +1384,7 @@ CBotClass* CBotClass::Compile1(CBotToken* &p, CBotCStack* pStack)
CBotClass* pPapa = NULL;
if ( IsOfType( p, ID_EXTENDS ) )
{
- CBotString name = p->GivString();
+ CBotString name = p->GetString();
pPapa = CBotClass::Find(name);
if (!IsOfType(p, TokenTypVar) || pPapa == NULL )
@@ -1454,7 +1454,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
{
CBotInstr* i = NULL;
- if ( p->GivType() != ID_CLBRK )
+ if ( p->GetType() != ID_CLBRK )
i = CBotExpression::Compile( p, pStack ); // expression for the value
else
i = new CBotEmpty(); // special if not a formula
@@ -1463,14 +1463,14 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
if (!pStack->IsOk() || !IsOfType( p, ID_CLBRK ) )
{
- pStack->SetError(TX_CLBRK, p->GivStart());
+ pStack->SetError(TX_CLBRK, p->GetStart());
return false;
}
-/* CBotVar* pv = pStack->GivVar();
- if ( pv->GivType()>= CBotTypBoolean )
+/* CBotVar* pv = pStack->GetVar();
+ if ( pv->GetType()>= CBotTypBoolean )
{
- pStack->SetError(TX_BADTYPE, p->GivStart());
+ pStack->SetError(TX_BADTYPE, p->GetStart());
return false;
}*/
@@ -1478,7 +1478,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
else limites->AddNext3(i);
}
- if ( p->GivType() == ID_OPENPAR )
+ if ( p->GetType() == ID_OPENPAR )
{
if ( !bSecond )
{
@@ -1498,12 +1498,12 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
CBotFunction* prev = NULL;
while ( pf != NULL )
{
- if (pf->GivName() == pp->GivString()) break;
+ if (pf->GetName() == pp->GetString()) break;
prev = pf;
pf = pf->Next();
}
- bool bConstructor = (pp->GivString() == GivName());
+ bool bConstructor = (pp->GetString() == GetName());
CBotCStack* pile = pStack->TokenStack(NULL, true);
// make "this" known
@@ -1531,9 +1531,9 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
{
CBotVar* pcopy = CBotVar::Create(pv);
pcopy->SetInit(!bConstructor || pv->IsStatic());
- pcopy->SetUniqNum(pv->GivUniqNum());
+ pcopy->SetUniqNum(pv->GetUniqNum());
pile->AddVar(pcopy);
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
my = my->m_pParent;
}
@@ -1545,7 +1545,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
if ( f != NULL )
{
- f->m_pProg = pStack->GivBotCall();
+ f->m_pProg = pStack->GetBotCall();
f->m_bSynchro = bSynchro;
// replaces the element in the chain
f->m_next = pf->m_next;
@@ -1572,7 +1572,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
{
if ( type.Eq(CBotTypArrayPointer) )
{
- i = CBotListArray::Compile(p, pStack, type.GivTypElem());
+ i = CBotListArray::Compile(p, pStack, type.GetTypElem());
}
else
{
@@ -1585,7 +1585,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
if ( !bSecond )
{
- CBotVar* pv = CBotVar::Create(pp->GivString(), type);
+ CBotVar* pv = CBotVar::Create(pp->GetString(), type);
pv -> SetStatic( bStatic );
pv -> SetPrivate( mProtect );
@@ -1599,7 +1599,7 @@ bool CBotClass::CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond)
{
CBotStack* pile = CBotStack::FirstStack(); // independent stack
while(pile->IsOk() && !pv->m_InitExpr->Execute(pile)); // evaluates the expression without timer
- pv->SetVal( pile->GivVar() ) ;
+ pv->SetVal( pile->GetVar() ) ;
pile->Delete();
}
}
@@ -1620,7 +1620,7 @@ CBotClass* CBotClass::Compile(CBotToken* &p, CBotCStack* pStack)
if ( !IsOfType(p, ID_PUBLIC) ) return NULL;
if ( !IsOfType(p, ID_CLASS) ) return NULL;
- CBotString name = p->GivString();
+ CBotString name = p->GetString();
// a name for the class is there?
if (IsOfType(p, TokenTypVar))
diff --git a/src/CBot/CBotIf.cpp b/src/CBot/CBotIf.cpp
index 84dbd6a..a5d2693 100644
--- a/src/CBot/CBotIf.cpp
+++ b/src/CBot/CBotIf.cpp
@@ -95,7 +95,7 @@ bool CBotIf :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
// according to recovery, it may be in one of two states
- if( pile->GivState() == 0 )
+ if( pile->GetState() == 0 )
{
// evaluates the condition
if ( !m_Condition->Execute(pile) ) return false; // interrupted here?
@@ -113,7 +113,7 @@ bool CBotIf :: Execute(CBotStack* &pj)
// second state, evaluates the associated instructions
// the result of the condition is on the stack
- if ( pile->GivVal() == true ) // condition was true?
+ if ( pile->GetVal() == true ) // condition was true?
{
if ( m_Block != NULL && // block may be absent
!m_Block->Execute(pile) ) return false; // interrupted here?
@@ -137,7 +137,7 @@ void CBotIf :: RestoreState(CBotStack* &pj, bool bMain)
if ( pile == NULL ) return;
// according to recovery, it may be in one of two states
- if( pile->GivState() == 0 )
+ if( pile->GetState() == 0 )
{
// evaluates the condition
m_Condition->RestoreState(pile, bMain); // interrupted here!
@@ -147,7 +147,7 @@ void CBotIf :: RestoreState(CBotStack* &pj, bool bMain)
// second state, evaluates the associated instructions
// the result of the condition is on the stack
- if ( pile->GivVal() == true ) // condition was true?
+ if ( pile->GetVal() == true ) // condition was true?
{
if ( m_Block != NULL ) // block may be absent
m_Block->RestoreState(pile, bMain); // interrupted here!
diff --git a/src/CBot/CBotProgram.cpp b/src/CBot/CBotProgram.cpp
index d9be052..4ffd6af 100644
--- a/src/CBot/CBotProgram.cpp
+++ b/src/CBot/CBotProgram.cpp
@@ -87,18 +87,18 @@ bool CBotProgram::Compile( const char* program, CBotStringArray& ListFonctions,
CBotCStack* pStack = new CBotCStack(NULL);
- CBotToken* p = pBaseToken->GivNext(); // skips the first token (separator)
+ CBotToken* p = pBaseToken->GetNext(); // skips the first token (separator)
pStack->SetBotCall(this); // defined used routines
CBotCall::SetPUser(pUser);
// first made a quick pass just to take the headers of routines and classes
- while ( pStack->IsOk() && p != NULL && p->GivType() != 0)
+ while ( pStack->IsOk() && p != NULL && p->GetType() != 0)
{
if ( IsOfType(p, ID_SEP) ) continue; // semicolons lurking
- if ( p->GivType() == ID_CLASS ||
- ( p->GivType() == ID_PUBLIC && p->GivNext()->GivType() == ID_CLASS ))
+ if ( p->GetType() == ID_CLASS ||
+ ( p->GetType() == ID_PUBLIC && p->GetNext()->GetType() == ID_CLASS ))
{
CBotClass* nxt = CBotClass::Compile1(p, pStack);
if (m_pClass == NULL ) m_pClass = nxt;
@@ -113,7 +113,7 @@ bool CBotProgram::Compile( const char* program, CBotStringArray& ListFonctions,
}
if ( !pStack->IsOk() )
{
- m_ErrorCode = pStack->GivError(m_ErrorStart, m_ErrorEnd);
+ m_ErrorCode = pStack->GetError(m_ErrorStart, m_ErrorEnd);
delete m_Prog;
m_Prog = NULL;
delete pBaseToken;
@@ -123,14 +123,14 @@ bool CBotProgram::Compile( const char* program, CBotStringArray& ListFonctions,
// CBotFunction* temp = NULL;
CBotFunction* next = m_Prog; // rewind the list
- p = pBaseToken->GivNext(); // returns to the beginning
+ p = pBaseToken->GetNext(); // returns to the beginning
- while ( pStack->IsOk() && p != NULL && p->GivType() != 0 )
+ while ( pStack->IsOk() && p != NULL && p->GetType() != 0 )
{
if ( IsOfType(p, ID_SEP) ) continue; // semicolons lurking
- if ( p->GivType() == ID_CLASS ||
- ( p->GivType() == ID_PUBLIC && p->GivNext()->GivType() == ID_CLASS ))
+ if ( p->GetType() == ID_CLASS ||
+ ( p->GetType() == ID_PUBLIC && p->GetNext()->GetType() == ID_CLASS ))
{
m_bCompileClass = true;
CBotClass::Compile(p, pStack); // completes the definition of the class
@@ -139,7 +139,7 @@ bool CBotProgram::Compile( const char* program, CBotStringArray& ListFonctions,
{
m_bCompileClass = false;
CBotFunction::Compile(p, pStack, next);
- if (next->IsExtern()) ListFonctions.Add(next->GivName()/* + next->GivParams()*/);
+ if (next->IsExtern()) ListFonctions.Add(next->GetName()/* + next->GetParams()*/);
next->m_pProg = this; // keeps pointers to the module
next = next->Next();
}
@@ -150,7 +150,7 @@ bool CBotProgram::Compile( const char* program, CBotStringArray& ListFonctions,
if ( !pStack->IsOk() )
{
- m_ErrorCode = pStack->GivError(m_ErrorStart, m_ErrorEnd);
+ m_ErrorCode = pStack->GetError(m_ErrorStart, m_ErrorEnd);
delete m_Prog;
m_Prog = NULL;
}
@@ -174,7 +174,7 @@ bool CBotProgram::Start(const char* name)
m_pRun = m_Prog;
while (m_pRun != NULL)
{
- if ( m_pRun->GivName() == name ) break;
+ if ( m_pRun->GetName() == name ) break;
m_pRun = m_pRun->m_next;
}
@@ -200,7 +200,7 @@ bool CBotProgram::GetPosition(const char* name, int& start, int& stop, CBotGet m
CBotFunction* p = m_Prog;
while (p != NULL)
{
- if ( p->GivName() == name ) break;
+ if ( p->GetName() == name ) break;
p = p->m_next;
}
@@ -248,7 +248,7 @@ bool CBotProgram::Run(void* pUser, int timer)
// completed on a mistake?
if (!ok && !m_pStack->IsOk())
{
- m_ErrorCode = m_pStack->GivError(m_ErrorStart, m_ErrorEnd);
+ m_ErrorCode = m_pStack->GetError(m_ErrorStart, m_ErrorEnd);
#if STACKMEM
m_pStack->Delete();
#else
@@ -289,12 +289,12 @@ bool CBotProgram::GetRunPos(const char* &FunctionName, int &start, int &end)
return true;
}
-CBotVar* CBotProgram::GivStackVars(const char* &FunctionName, int level)
+CBotVar* CBotProgram::GetStackVars(const char* &FunctionName, int level)
{
FunctionName = NULL;
if (m_pStack == NULL) return NULL;
- return m_pStack->GivStackVars(FunctionName, level);
+ return m_pStack->GetStackVars(FunctionName, level);
}
void CBotProgram::SetTimer(int n)
@@ -302,7 +302,7 @@ void CBotProgram::SetTimer(int n)
CBotStack::SetTimer( n );
}
-int CBotProgram::GivError()
+int CBotProgram::GetError()
{
return m_ErrorCode;
}
@@ -312,7 +312,7 @@ void CBotProgram::SetIdent(long n)
m_Ident = n;
}
-long CBotProgram::GivIdent()
+long CBotProgram::GetIdent()
{
return m_Ident;
}
@@ -334,7 +334,7 @@ bool CBotProgram::GetError(int& code, int& start, int& end, CBotProgram* &pProg)
return code > 0;
}
-CBotString CBotProgram::GivErrorText(int code)
+CBotString CBotProgram::GetErrorText(int code)
{
CBotString TextError;
@@ -349,7 +349,7 @@ CBotString CBotProgram::GivErrorText(int code)
}
-CBotFunction* CBotProgram::GivFunctions()
+CBotFunction* CBotProgram::GetFunctions()
{
return m_Prog;
}
@@ -421,7 +421,7 @@ bool WriteString(FILE* pf, CBotString s)
{
size_t lg1, lg2;
- lg1 = s.GivLength();
+ lg1 = s.GetLength();
if (!WriteWord(pf, lg1)) return false;
lg2 = fwrite(s, 1, lg1, pf );
@@ -445,19 +445,19 @@ bool ReadString(FILE* pf, CBotString& s)
bool WriteType(FILE* pf, CBotTypResult type)
{
- int typ = type.GivType();
+ int typ = type.GetType();
if ( typ == CBotTypIntrinsic ) typ = CBotTypClass;
if ( !WriteWord(pf, typ) ) return false;
if ( typ == CBotTypClass )
{
- CBotClass* p = type.GivClass();
- if ( !WriteString(pf, p->GivName()) ) return false;
+ CBotClass* p = type.GetClass();
+ if ( !WriteString(pf, p->GetName()) ) return false;
}
if ( type.Eq( CBotTypArrayBody ) ||
type.Eq( CBotTypArrayPointer ) )
{
- if ( !WriteWord(pf, type.GivLimite()) ) return false;
- if ( !WriteType(pf, type.GivTypElem()) ) return false;
+ if ( !WriteWord(pf, type.GetLimite()) ) return false;
+ if ( !WriteType(pf, type.GetTypElem()) ) return false;
}
return true;
}
@@ -507,7 +507,7 @@ bool CBotProgram::SaveState(FILE* pf)
if ( m_pStack != NULL )
{
if (!WriteWord( pf, 1)) return false;
- if (!WriteString( pf, m_pRun->GivName() )) return false;
+ if (!WriteString( pf, m_pRun->GetName() )) return false;
if (!m_pStack->SaveState(pf)) return false;
}
else
@@ -551,7 +551,7 @@ bool CBotProgram::RestoreState(FILE* pf)
return true;
}
-int CBotProgram::GivVersion()
+int CBotProgram::GetVersion()
{
return CBOTVERSION;
}
@@ -592,7 +592,7 @@ bool CBotCall::AddFunction(const char* name,
if ( p != NULL ) while ( p->m_next != NULL )
{
- if ( p->GivName() == name )
+ if ( p->GetName() == name )
{
// frees redefined function
if ( pp ) pp->m_next = p->m_next;
@@ -631,8 +631,8 @@ CBotVar* MakeListVars(CBotVar** ppVars, bool bSetVal=false)
CBotVar* pp = CBotVar::Create(ppVars[i]);
if (bSetVal) pp->Copy(ppVars[i]);
else
- if ( ppVars[i]->GivType() == CBotTypPointer )
- pp->SetClass( ppVars[i]->GivClass());
+ if ( ppVars[i]->GetType() == CBotTypPointer )
+ pp->SetClass( ppVars[i]->GetClass());
// copy the pointer according to indirections
if (pVar == NULL) pVar = pp;
else pVar->AddNext(pp);
@@ -648,7 +648,7 @@ CBotTypResult CBotCall::CompileCall(CBotToken* &p, CBotVar** ppVar, CBotCStack*
{
nIdent = 0;
CBotCall* pt = m_ListCalls;
- CBotString name = p->GivString();
+ CBotString name = p->GetString();
while ( pt != NULL )
{
@@ -657,14 +657,14 @@ CBotTypResult CBotCall::CompileCall(CBotToken* &p, CBotVar** ppVar, CBotCStack*
CBotVar* pVar = MakeListVars(ppVar);
CBotVar* pVar2 = pVar;
CBotTypResult r = pt->m_rComp(pVar2, m_pUser);
- int ret = r.GivType();
+ int ret = r.GetType();
// if a class is returned, it is actually a pointer
if ( ret == CBotTypClass ) r.SetType( ret = CBotTypPointer );
if ( ret > 20 )
{
- if (pVar2) pStack->SetError(ret, p /*pVar2->GivToken()*/ );
+ if (pVar2) pStack->SetError(ret, p /*pVar2->GetToken()*/ );
}
delete pVar;
nIdent = pt->m_nFuncIdent;
@@ -688,7 +688,7 @@ bool CBotCall::CheckCall(const char* name)
while ( p != NULL )
{
- if ( name == p->GivName() ) return true;
+ if ( name == p->GetName() ) return true;
p = p->m_next;
}
return false;
@@ -696,7 +696,7 @@ bool CBotCall::CheckCall(const char* name)
-CBotString CBotCall::GivName()
+CBotString CBotCall::GetName()
{
return m_name;
}
@@ -724,7 +724,7 @@ int CBotCall::DoCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBotStack*
if ( token != NULL )
{
- CBotString name = token->GivString();
+ CBotString name = token->GetString();
while ( pt != NULL )
{
if ( pt->m_name == name )
@@ -750,7 +750,7 @@ fund:
CBotVar* pRes = pResult;
int Exception = 0;
- int res = pt->m_rExec(pVar, pResult, Exception, pStack->GivPUser());
+ int res = pt->m_rExec(pVar, pResult, Exception, pStack->GetPUser());
if ( pResult != pRes ) delete pRes; // different result if made
delete pVarToDelete;
@@ -766,7 +766,7 @@ fund:
}
pStack->SetVar(pResult);
- if ( rettype.GivType() > 0 && pResult == NULL )
+ if ( rettype.GetType() > 0 && pResult == NULL )
{
pStack->SetError(TX_NORETVAL, token);
}
@@ -805,7 +805,7 @@ bool CBotCall::RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBot
CBotCall* pt = m_ListCalls;
{
- CBotString name = token->GivString();
+ CBotString name = token->GetString();
while ( pt != NULL )
{
if ( pt->m_name == name )
@@ -829,14 +829,14 @@ bool CBotCall::Run(CBotStack* pStack)
{
CBotStack* pile = pStack->AddStackEOX(this);
if ( pile == EOX ) return true;
- CBotVar* pVar = pile->GivVar();
+ CBotVar* pVar = pile->GetVar();
CBotStack* pile2 = pile->AddStack();
- CBotVar* pResult = pile2->GivVar();
+ CBotVar* pResult = pile2->GetVar();
CBotVar* pRes = pResult;
int Exception = 0;
- int res = m_rExec(pVar, pResult, Exception, pStack->GivPUser());
+ int res = m_rExec(pVar, pResult, Exception, pStack->GetPUser());
if (res == false)
{
@@ -892,10 +892,10 @@ CBotTypResult CBotCallMethode::CompileCall(const char* name, CBotVar* pThis,
CBotVar* pVar = MakeListVars(ppVar, true);
CBotVar* pVar2 = pVar;
CBotTypResult r = pt->m_rComp(pThis, pVar2);
- int ret = r.GivType();
+ int ret = r.GetType();
if ( ret > 20 )
{
- if (pVar2) pStack->SetError(ret, pVar2->GivToken());
+ if (pVar2) pStack->SetError(ret, pVar2->GetToken());
}
delete pVar;
nIdent = pt->m_nFuncIdent;
@@ -907,7 +907,7 @@ CBotTypResult CBotCallMethode::CompileCall(const char* name, CBotVar* pThis,
}
-CBotString CBotCallMethode::GivName()
+CBotString CBotCallMethode::GetName()
{
return m_name;
}
@@ -951,7 +951,7 @@ int CBotCallMethode::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBot
{
if (Exception!=0)
{
-// pStack->SetError(Exception, pVar->GivToken());
+// pStack->SetError(Exception, pVar->GetToken());
pStack->SetError(Exception, pToken);
}
delete pVarToDelete;
@@ -982,7 +982,7 @@ int CBotCallMethode::DoCall(long& nIdent, const char* name, CBotVar* pThis, CBot
{
if (Exception!=0)
{
-// pStack->SetError(Exception, pVar->GivToken());
+// pStack->SetError(Exception, pVar->GetToken());
pStack->SetError(Exception, pToken);
}
delete pVarToDelete;
@@ -1003,12 +1003,12 @@ bool rSizeOf( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) return TX_LOWPARAM;
int i = 0;
- pVar = pVar->GivItemList();
+ pVar = pVar->GetItemList();
while ( pVar != NULL )
{
i++;
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
}
pResult->SetValInt(i);
@@ -1018,7 +1018,7 @@ bool rSizeOf( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
CBotTypResult cSizeOf( CBotVar* &pVar, void* pUser )
{
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
- if ( pVar->GivType() != CBotTypArrayPointer )
+ if ( pVar->GetType() != CBotTypArrayPointer )
return CBotTypResult( TX_BADPARAM );
return CBotTypResult( CBotTypInt );
}
diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp
index ddb26c6..b6a90c9 100644
--- a/src/CBot/CBotStack.cpp
+++ b/src/CBot/CBotStack.cpp
@@ -198,7 +198,7 @@ CBotStack* CBotStack::AddStack2(bool bBlock)
return p;
}
-bool CBotStack::GivBlock()
+bool CBotStack::GetBlock()
{
return m_bBlock;
}
@@ -428,7 +428,7 @@ void CBotStack::SetBreak(int val, const char* name)
// gives on the stack value calculated by the last CBotReturn
-bool CBotStack::GivRetVar(bool bRet)
+bool CBotStack::GetRetVar(bool bRet)
{
if (m_error == -3)
{
@@ -441,7 +441,7 @@ bool CBotStack::GivRetVar(bool bRet)
return bRet; // interrupted by something other than return
}
-int CBotStack::GivError(int& start, int& end)
+int CBotStack::GetError(int& start, int& end)
{
start = m_start;
end = m_end;
@@ -449,16 +449,16 @@ int CBotStack::GivError(int& start, int& end)
}
-int CBotStack::GivType(int mode)
+int CBotStack::GetType(int mode)
{
if (m_var == NULL) return -1;
- return m_var->GivType(mode);
+ return m_var->GetType(mode);
}
-CBotTypResult CBotStack::GivTypResult(int mode)
+CBotTypResult CBotStack::GetTypResult(int mode)
{
if (m_var == NULL) return -1;
- return m_var->GivTypResult(mode);
+ return m_var->GetTypResult(mode);
}
void CBotStack::SetType(CBotTypResult& type)
@@ -471,14 +471,14 @@ void CBotStack::SetType(CBotTypResult& type)
CBotVar* CBotStack::FindVar(CBotToken* &pToken, bool bUpdate, bool bModif)
{
CBotStack* p = this;
- CBotString name = pToken->GivString();
+ CBotString name = pToken->GetString();
while (p != NULL)
{
CBotVar* pp = p->m_listVar;
while ( pp != NULL)
{
- if (pp->GivName() == name)
+ if (pp->GetName() == name)
{
if ( bUpdate )
pp->Maj(m_pUser, false);
@@ -500,7 +500,7 @@ CBotVar* CBotStack::FindVar(const char* name)
CBotVar* pp = p->m_listVar;
while ( pp != NULL)
{
- if (pp->GivName() == name)
+ if (pp->GetName() == name)
{
return pp;
}
@@ -519,7 +519,7 @@ CBotVar* CBotStack::FindVar(long ident, bool bUpdate, bool bModif)
CBotVar* pp = p->m_listVar;
while ( pp != NULL)
{
- if (pp->GivUniqNum() == ident)
+ if (pp->GetUniqNum() == ident)
{
if ( bUpdate )
pp->Maj(m_pUser, false);
@@ -576,8 +576,8 @@ void CBotStack::SetError(int n, CBotToken* token)
m_error = n;
if (token != NULL)
{
- m_start = token->GivStart();
- m_end = token->GivEnd();
+ m_start = token->GetStart();
+ m_end = token->GetEnd();
}
}
@@ -590,8 +590,8 @@ void CBotStack::ResetError(int n, int start, int end)
void CBotStack::SetPosError(CBotToken* token)
{
- m_start = token->GivStart();
- m_end = token->GivEnd();
+ m_start = token->GetStart();
+ m_end = token->GetEnd();
}
void CBotStack::SetTimer(int n)
@@ -643,34 +643,34 @@ void CBotStack::SetCopyVar( CBotVar* var )
{
if (m_var) delete m_var; // replacement of a variable
- m_var = CBotVar::Create("", var->GivTypResult(2));
+ m_var = CBotVar::Create("", var->GetTypResult(2));
m_var->Copy( var );
}
-CBotVar* CBotStack::GivVar()
+CBotVar* CBotStack::GetVar()
{
return m_var;
}
-CBotVar* CBotStack::GivPtVar()
+CBotVar* CBotStack::GetPtVar()
{
CBotVar* p = m_var;
m_var = NULL; // therefore will not be destroyed
return p;
}
-CBotVar* CBotStack::GivCopyVar()
+CBotVar* CBotStack::GetCopyVar()
{
if (m_var == NULL) return NULL;
- CBotVar* v = CBotVar::Create("", m_var->GivType());
+ CBotVar* v = CBotVar::Create("", m_var->GetType());
v->Copy( m_var );
return v;
}
-long CBotStack::GivVal()
+long CBotStack::GetVal()
{
if (m_var == NULL) return 0;
- return m_var->GivValInt();
+ return m_var->GetValInt();
}
@@ -693,7 +693,7 @@ void CBotStack::AddVar(CBotVar* pVar)
*pp = pVar; // added after
#ifdef _DEBUG
- if ( pVar->GivUniqNum() == 0 ) ASM_TRAP();
+ if ( pVar->GetUniqNum() == 0 ) ASM_TRAP();
#endif
}
@@ -710,7 +710,7 @@ void CBotStack::SetBotCall(CBotProgram* p)
m_bFunc = true;
}
-CBotProgram* CBotStack::GivBotCall(bool bFirst)
+CBotProgram* CBotStack::GetBotCall(bool bFirst)
{
if ( ! bFirst ) return m_prog;
CBotStack* p = this;
@@ -718,7 +718,7 @@ CBotProgram* CBotStack::GivBotCall(bool bFirst)
return p->m_prog;
}
-void* CBotStack::GivPUser()
+void* CBotStack::GetPUser()
{
return m_pUser;
}
@@ -731,19 +731,19 @@ bool CBotStack::ExecuteCall(long& nIdent, CBotToken* token, CBotVar** ppVar, CBo
// first looks by the identifier
res = CBotCall::DoCall(nIdent, NULL, ppVar, this, rettype );
- if (res.GivType() >= 0) return res.GivType();
+ if (res.GetType() >= 0) return res.GetType();
- res = m_prog->GivFunctions()->DoCall(nIdent, NULL, ppVar, this, token );
- if (res.GivType() >= 0) return res.GivType();
+ res = m_prog->GetFunctions()->DoCall(nIdent, NULL, ppVar, this, token );
+ if (res.GetType() >= 0) return res.GetType();
// if not found (recompile?) seeks by name
nIdent = 0;
res = CBotCall::DoCall(nIdent, token, ppVar, this, rettype );
- if (res.GivType() >= 0) return res.GivType();
+ if (res.GetType() >= 0) return res.GetType();
- res = m_prog->GivFunctions()->DoCall(nIdent, token->GivString(), ppVar, this, token );
- if (res.GivType() >= 0) return res.GivType();
+ res = m_prog->GetFunctions()->DoCall(nIdent, token->GetString(), ppVar, this, token );
+ if (res.GetType() >= 0) return res.GetType();
SetError(TX_NOCALL, token);
return true;
@@ -754,7 +754,7 @@ void CBotStack::RestoreCall(long& nIdent, CBotToken* token, CBotVar** ppVar)
if ( m_next == NULL ) return;
if ( !CBotCall::RestoreCall(nIdent, token, ppVar, this) )
- m_prog->GivFunctions()->RestoreCall(nIdent, token->GivString(), ppVar, this );
+ m_prog->GetFunctions()->RestoreCall(nIdent, token->GetString(), ppVar, this );
}
@@ -770,7 +770,7 @@ bool SaveVar(FILE* pf, CBotVar* pVar)
if ( !pVar->Save0State(pf)) return false; // common header
if ( !pVar->Save1State(pf) ) return false; // saves as the child class
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
}
}
@@ -798,17 +798,17 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end)
if ( funct == NULL ) return;
- CBotToken* t = funct->GivToken();
- FunctionName = t->GivString();
+ CBotToken* t = funct->GetToken();
+ FunctionName = t->GetString();
// if ( p->m_instr != NULL ) instr = p->m_instr;
- t = instr->GivToken();
- start = t->GivStart();
- end = t->GivEnd();
+ t = instr->GetToken();
+ start = t->GetStart();
+ end = t->GetEnd();
}
-CBotVar* CBotStack::GivStackVars(const char* &FunctionName, int level)
+CBotVar* CBotStack::GetStackVars(const char* &FunctionName, int level)
{
CBotProgram* prog = m_prog; // current program
FunctionName = NULL;
@@ -846,8 +846,8 @@ CBotVar* CBotStack::GivStackVars(const char* &FunctionName, int level)
if ( pp == NULL || pp->m_instr == NULL ) return NULL;
- CBotToken* t = pp->m_instr->GivToken();
- FunctionName = t->GivString();
+ CBotToken* t = pp->m_instr->GetToken();
+ FunctionName = t->GetString();
return p->m_listVar;
}
@@ -924,9 +924,9 @@ bool CBotVar::Save0State(FILE* pf)
{
if (!WriteWord(pf, 100+m_mPrivate))return false; // private variable?
if (!WriteWord(pf, m_bStatic))return false; // static variable?
- if (!WriteWord(pf, m_type.GivType()))return false; // saves the type (always non-zero)
+ if (!WriteWord(pf, m_type.GetType()))return false; // saves the type (always non-zero)
if (!WriteWord(pf, m_binit))return false; // variable defined?
- return WriteString(pf, m_token->GivString()); // and variable name
+ return WriteString(pf, m_token->GetString()); // and variable name
}
bool CBotVarInt::Save0State(FILE* pf)
@@ -1160,7 +1160,7 @@ CBotCStack* CBotCStack::TokenStack(CBotToken* pToken, bool bBlock)
m_next = p; // channel element
p->m_bBlock = bBlock;
- if (pToken != NULL) p->SetStartError(pToken->GivStart());
+ if (pToken != NULL) p->SetStartError(pToken->GetStart());
return p;
}
@@ -1200,42 +1200,42 @@ CBotFunction* CBotCStack::ReturnFunc(CBotFunction* inst, CBotCStack* pfils)
return inst;
}
-int CBotCStack::GivError(int& start, int& end)
+int CBotCStack::GetError(int& start, int& end)
{
start = m_start;
end = m_end;
return m_error;
}
-int CBotCStack::GivError()
+int CBotCStack::GetError()
{
return m_error;
}
// type of instruction on the stack
-CBotTypResult CBotCStack::GivTypResult(int mode)
+CBotTypResult CBotCStack::GetTypResult(int mode)
{
if (m_var == NULL)
return CBotTypResult(99);
- return m_var->GivTypResult(mode);
+ return m_var->GetTypResult(mode);
}
// type of instruction on the stack
-int CBotCStack::GivType(int mode)
+int CBotCStack::GetType(int mode)
{
if (m_var == NULL)
return 99;
- return m_var->GivType(mode);
+ return m_var->GetType(mode);
}
// pointer on the stack is in what class?
-CBotClass* CBotCStack::GivClass()
+CBotClass* CBotCStack::GetClass()
{
if ( m_var == NULL )
return NULL;
- if ( m_var->GivType(1) != CBotTypPointer ) return NULL;
+ if ( m_var->GetType(1) != CBotTypPointer ) return NULL;
- return m_var->GivClass();
+ return m_var->GetClass();
}
// type of instruction on the stack
@@ -1252,14 +1252,14 @@ void CBotCStack::SetType(CBotTypResult& type)
CBotVar* CBotCStack::FindVar(CBotToken* &pToken)
{
CBotCStack* p = this;
- CBotString name = pToken->GivString();
+ CBotString name = pToken->GetString();
while (p != NULL)
{
CBotVar* pp = p->m_listVar;
while ( pp != NULL)
{
- if (name == pp->GivName())
+ if (name == pp->GetName())
{
return pp;
}
@@ -1282,7 +1282,7 @@ CBotVar* CBotCStack::CopyVar(CBotToken& Token)
if ( pVar == NULL) return NULL;
- CBotVar* pCopy = CBotVar::Create( "", pVar->GivType() );
+ CBotVar* pCopy = CBotVar::Create( "", pVar->GetType() );
pCopy->Copy(pVar);
return pCopy;
}
@@ -1310,8 +1310,8 @@ void CBotCStack::SetError(int n, CBotToken* p)
{
if (m_error) return; // does not change existing error
m_error = n;
- m_start = p->GivStart();
- m_end = p->GivEnd();
+ m_start = p->GetStart();
+ m_end = p->GetEnd();
}
void CBotCStack::ResetError(int n, int start, int end)
@@ -1325,10 +1325,10 @@ bool CBotCStack::NextToken(CBotToken* &p)
{
CBotToken* pp = p;
- p = p->GivNext();
+ p = p->GetNext();
if (p!=NULL) return true;
- SetError(TX_ENDOF, pp->GivEnd());
+ SetError(TX_ENDOF, pp->GetEnd());
return false;
}
@@ -1337,7 +1337,7 @@ void CBotCStack::SetBotCall(CBotProgram* p)
m_prog = p;
}
-CBotProgram* CBotCStack::GivBotCall()
+CBotProgram* CBotCStack::GetBotCall()
{
return m_prog;
}
@@ -1347,7 +1347,7 @@ void CBotCStack::SetRetType(CBotTypResult& type)
m_retTyp = type;
}
-CBotTypResult CBotCStack::GivRetType()
+CBotTypResult CBotCStack::GetRetType()
{
return m_retTyp;
}
@@ -1364,11 +1364,11 @@ void CBotCStack::SetCopyVar( CBotVar* var )
if (m_var) delete m_var; // replacement of a variable
if ( var == NULL ) return;
- m_var = CBotVar::Create("", var->GivTypResult(2));
+ m_var = CBotVar::Create("", var->GetTypResult(2));
m_var->Copy( var );
}
-CBotVar* CBotCStack::GivVar()
+CBotVar* CBotCStack::GetVar()
{
return m_var;
}
@@ -1388,7 +1388,7 @@ void CBotCStack::AddVar(CBotVar* pVar)
*pp = pVar; // added after
#ifdef _DEBUG
- if ( pVar->GivUniqNum() == 0 ) ASM_TRAP();
+ if ( pVar->GetUniqNum() == 0 ) ASM_TRAP();
#endif
}
@@ -1397,14 +1397,14 @@ void CBotCStack::AddVar(CBotVar* pVar)
bool CBotCStack::CheckVarLocal(CBotToken* &pToken)
{
CBotCStack* p = this;
- CBotString name = pToken->GivString();
+ CBotString name = pToken->GetString();
while (p != NULL)
{
CBotVar* pp = p->m_listVar;
while ( pp != NULL)
{
- if (name == pp->GivName())
+ if (name == pp->GetName())
return true;
pp = pp->m_next;
}
@@ -1420,14 +1420,14 @@ CBotTypResult CBotCStack::CompileCall(CBotToken* &p, CBotVar** ppVars, long& nId
CBotTypResult val(-1);
val = CBotCall::CompileCall(p, ppVars, this, nIdent);
- if (val.GivType() < 0)
+ if (val.GetType() < 0)
{
- val = m_prog->GivFunctions()->CompileCall(p->GivString(), ppVars, nIdent);
- if ( val.GivType() < 0 )
+ val = m_prog->GetFunctions()->CompileCall(p->GetString(), ppVars, nIdent);
+ if ( val.GetType() < 0 )
{
// pVar = NULL; // the error is not on a particular parameter
- SetError( -val.GivType(), p );
- val.SetType(-val.GivType());
+ SetError( -val.GetType(), p );
+ val.SetType(-val.GetType());
return val;
}
}
@@ -1438,14 +1438,14 @@ CBotTypResult CBotCStack::CompileCall(CBotToken* &p, CBotVar** ppVars, long& nId
bool CBotCStack::CheckCall(CBotToken* &pToken, CBotDefParam* pParam)
{
- CBotString name = pToken->GivString();
+ CBotString name = pToken->GetString();
if ( CBotCall::CheckCall(name) ) return true;
- CBotFunction* pp = m_prog->GivFunctions();
+ CBotFunction* pp = m_prog->GetFunctions();
while ( pp != NULL )
{
- if ( pToken->GivString() == pp->GivName() )
+ if ( pToken->GetString() == pp->GetName() )
{
// are parameters exactly the same?
if ( pp->CheckParam( pParam ) )
@@ -1457,7 +1457,7 @@ bool CBotCStack::CheckCall(CBotToken* &pToken, CBotDefParam* pParam)
pp = CBotFunction::m_listPublic;
while ( pp != NULL )
{
- if ( pToken->GivString() == pp->GivName() )
+ if ( pToken->GetString() == pp->GetName() )
{
// are parameters exactly the same?
if ( pp->CheckParam( pParam ) )
diff --git a/src/CBot/CBotString.cpp b/src/CBot/CBotString.cpp
index d471ed0..b146a38 100644
--- a/src/CBot/CBotString.cpp
+++ b/src/CBot/CBotString.cpp
@@ -138,7 +138,7 @@ CBotString::CBotString(const char* p)
m_ptr = NULL;
if (m_lg>0)
{
- m_ptr = (char*)malloc(m_lg+1);
+ m_ptr = static_cast<char*>(malloc(m_lg+1));
strcpy(m_ptr, p);
}
}
@@ -150,7 +150,7 @@ CBotString::CBotString(const CBotString& srcString)
m_ptr = NULL;
if (m_lg>0)
{
- m_ptr = (char*)malloc(m_lg+1);
+ m_ptr = static_cast<char*>(malloc(m_lg+1));
strcpy(m_ptr, srcString.m_ptr);
}
}
@@ -158,7 +158,7 @@ CBotString::CBotString(const CBotString& srcString)
-int CBotString::GivLength()
+int CBotString::GetLength()
{
if (m_ptr == NULL) return 0;
return strlen( m_ptr );
@@ -285,7 +285,7 @@ CBotString CBotString::Mid(int start, int lg)
if ( lg < 0 ) lg = m_lg - start;
- char* p = (char*)malloc(m_lg+1);
+ char* p = static_cast<char*>(malloc(m_lg+1));
strcpy(p, m_ptr+start);
p[lg] = 0;
@@ -322,7 +322,7 @@ bool CBotString::LoadString(unsigned int id)
m_ptr = NULL;
if (m_lg > 0)
{
- m_ptr = (char*)malloc(m_lg+1);
+ m_ptr = static_cast<char*>(malloc(m_lg+1));
strcpy(m_ptr, str);
return true;
}
@@ -339,7 +339,7 @@ const CBotString& CBotString::operator=(const CBotString& stringSrc)
if (m_lg > 0)
{
- m_ptr = (char*)malloc(m_lg+1);
+ m_ptr = static_cast<char*>(malloc(m_lg+1));
strcpy(m_ptr, stringSrc.m_ptr);
}
@@ -355,7 +355,7 @@ CBotString operator+(const CBotString& string, const char * lpsz)
const CBotString& CBotString::operator+(const CBotString& stringSrc)
{
- char* p = (char*)malloc(m_lg+stringSrc.m_lg+1);
+ char* p = static_cast<char*>(malloc(m_lg+stringSrc.m_lg+1));
strcpy(p, m_ptr);
char* pp = p + m_lg;
@@ -392,7 +392,7 @@ const CBotString& CBotString::operator=(const char* pString)
if (m_lg != 0)
{
- m_ptr = (char*)malloc(m_lg+1);
+ m_ptr = static_cast<char*>(malloc(m_lg+1));
strcpy(m_ptr, pString);
}
}
@@ -549,7 +549,7 @@ CBotStringArray::~CBotStringArray()
}
-int CBotStringArray::GivSize()
+int CBotStringArray::GetSize()
{
return m_nSize;
}
diff --git a/src/CBot/CBotToken.cpp b/src/CBot/CBotToken.cpp
index 2c0bfae..d4973e9 100644
--- a/src/CBot/CBotToken.cpp
+++ b/src/CBot/CBotToken.cpp
@@ -123,25 +123,25 @@ const CBotToken& CBotToken::operator=(const CBotToken& src)
}
-int CBotToken::GivType()
+int CBotToken::GetType()
{
if (this == NULL) return 0;
if (m_type == TokenTypKeyWord) return m_IdKeyWord;
return m_type;
}
-long CBotToken::GivIdKey()
+long CBotToken::GetIdKey()
{
return m_IdKeyWord;
}
-CBotToken* CBotToken::GivNext()
+CBotToken* CBotToken::GetNext()
{
if (this == NULL) return NULL;
return m_next;
}
-CBotToken* CBotToken::GivPrev()
+CBotToken* CBotToken::GetPrev()
{
if (this == NULL) return NULL;
return m_prev;
@@ -159,12 +159,12 @@ void CBotToken::AddNext(CBotToken* p)
}
-CBotString& CBotToken::GivString()
+CBotString& CBotToken::GetString()
{
return m_Text;
}
-CBotString& CBotToken::GivSep()
+CBotString& CBotToken::GetSep()
{
return m_Sep;
}
@@ -175,13 +175,13 @@ void CBotToken::SetString(const char* name)
}
-int CBotToken::GivStart()
+int CBotToken::GetStart()
{
if (this == NULL) return -1;
return m_start;
}
-int CBotToken::GivEnd()
+int CBotToken::GetEnd()
{
if (this == NULL) return -1;
return m_end;
@@ -309,7 +309,7 @@ cc: mot += c;
if (CharInList(mot[0], sep3)) // an operational separator?
{
CBotString motc = mot;
- while (motc += c, c != 0 && GivKeyWords(motc)>0) // operand seeks the longest possible
+ while (motc += c, c != 0 && GetKeyWords(motc)>0) // operand seeks the longest possible
{
mot += c; // build the word
c = *(program++); // next character
@@ -367,9 +367,9 @@ bis:
if (mot[0] == '\"') token->m_type = TokenTypString;
if (first) token->m_type = 0;
- token->m_IdKeyWord = GivKeyWords(mot);
+ token->m_IdKeyWord = GetKeyWords(mot);
if (token->m_IdKeyWord > 0) token->m_type = TokenTypKeyWord;
- else GivKeyDefNum(mot, token) ; // treats DefineNum
+ else GetKeyDefNum(mot, token) ; // treats DefineNum
return token;
}
@@ -391,9 +391,9 @@ CBotToken* CBotToken::CompileTokens(const char* program, int& error)
if (tokenbase == NULL) return NULL;
tokenbase->m_start = pos;
- pos += tokenbase->m_Text.GivLength();
+ pos += tokenbase->m_Text.GetLength();
tokenbase->m_end = pos;
- pos += tokenbase->m_Sep.GivLength();
+ pos += tokenbase->m_Sep.GetLength();
char* pp = p;
while (NULL != (nxt = NextToken(p, error)))
@@ -403,11 +403,11 @@ CBotToken* CBotToken::CompileTokens(const char* program, int& error)
prv = nxt; // advance
nxt->m_start = pos;
-/* pos += nxt->m_Text.GivLength(); // chain may be shorter (BOA deleted)
+/* pos += nxt->m_Text.GetLength(); // chain may be shorter (BOA deleted)
nxt->m_end = pos;
- pos += nxt->m_Sep.GivLength();*/
+ pos += nxt->m_Sep.GetLength();*/
pos += (p - pp); // total size
- nxt->m_end = pos - nxt->m_Sep.GivLength();
+ nxt->m_end = pos - nxt->m_Sep.GetLength();
pp = p;
}
@@ -429,15 +429,15 @@ void CBotToken::Delete(CBotToken* pToken)
// search if a word is part of the keywords
-int CBotToken::GivKeyWords(const char* w)
+int CBotToken::GetKeyWords(const char* w)
{
int i;
- int l = m_ListKeyWords.GivSize();
+ int l = m_ListKeyWords.GetSize();
if (l == 0)
{
LoadKeyWords(); // takes the list for the first time
- l = m_ListKeyWords.GivSize();
+ l = m_ListKeyWords.GetSize();
}
for (i = 0; i < l; i++)
@@ -448,10 +448,10 @@ int CBotToken::GivKeyWords(const char* w)
return -1;
}
-bool CBotToken::GivKeyDefNum(const char* w, CBotToken* &token)
+bool CBotToken::GetKeyDefNum(const char* w, CBotToken* &token)
{
int i;
- int l = m_ListKeyDefine.GivSize();
+ int l = m_ListKeyDefine.GetSize();
for (i = 0; i < l; i++)
{
@@ -510,7 +510,7 @@ void CBotToken::LoadKeyWords()
bool CBotToken::DefineNum(const char* name, long val)
{
int i;
- int l = m_ListKeyDefine.GivSize();
+ int l = m_ListKeyDefine.GetSize();
for (i = 0; i < l; i++)
{
@@ -525,10 +525,10 @@ bool CBotToken::DefineNum(const char* name, long val)
bool IsOfType(CBotToken* &p, int type1, int type2)
{
- if (p->GivType() == type1 ||
- p->GivType() == type2 )
+ if (p->GetType() == type1 ||
+ p->GetType() == type2 )
{
- p = p->GivNext();
+ p = p->GetNext();
return true;
}
return false;
@@ -539,7 +539,7 @@ bool IsOfTypeList(CBotToken* &p, int type1, ...)
{
int i = type1;
int max = 20;
- int type = p->GivType();
+ int type = p->GetType();
va_list marker;
va_start( marker, type1 ); /* Initialize variable arguments. */
@@ -548,7 +548,7 @@ bool IsOfTypeList(CBotToken* &p, int type1, ...)
{
if (type == i)
{
- p = p->GivNext();
+ p = p->GetNext();
va_end( marker ); /* Reset variable arguments. */
return true;
}
diff --git a/src/CBot/CBotTwoOpExpr.cpp b/src/CBot/CBotTwoOpExpr.cpp
index 62290da..80a3bb0 100644
--- a/src/CBot/CBotTwoOpExpr.cpp
+++ b/src/CBot/CBotTwoOpExpr.cpp
@@ -136,11 +136,11 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
if (left == NULL) return pStack->Return(NULL, pStk); // if error, transmit
// did we expected the operand?
- int TypeOp = p->GivType();
+ int TypeOp = p->GetType();
if ( IsInList( TypeOp, pOperations, typemasque ) )
{
CBotTypResult type1, type2;
- type1 = pStk->GivTypResult(); // what kind of the first operand?
+ type1 = pStk->GetTypResult(); // what kind of the first operand?
if ( TypeOp == ID_LOGIC ) // special case provided for: ? op1: op2;
{
@@ -152,25 +152,25 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
CBotLogicExpr* inst = new CBotLogicExpr();
inst->m_condition = left;
- p = p->GivNext(); // skip the token of the operation
+ p = p->GetNext(); // skip the token of the operation
inst->m_op1 = CBotExpression::Compile(p, pStk);
CBotToken* pp = p;
if ( inst->m_op1 == NULL || !IsOfType( p, ID_DOTS ) )
{
- pStk->SetError( TX_MISDOTS, p->GivStart());
+ pStk->SetError( TX_MISDOTS, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk);
}
- type1 = pStk->GivTypResult();
+ type1 = pStk->GetTypResult();
inst->m_op2 = CBotExpression::Compile(p, pStk);
if ( inst->m_op2 == NULL )
{
- pStk->SetError( TX_ENDOF, p->GivStart() );
+ pStk->SetError( TX_ENDOF, p->GetStart() );
delete inst;
return pStack->Return(NULL, pStk);
}
- type2 = pStk->GivTypResult();
+ type2 = pStk->GetTypResult();
if (!TypeCompatible(type1, type2))
{
pStk->SetError( TX_BAD2TYPE, pp );
@@ -187,7 +187,7 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
inst->SetToken(p); // stores the operation
- p = p->GivNext(); // skip the token of the operation
+ p = p->GetNext(); // skip the token of the operation
// looking statements that may be suitable for right
@@ -196,10 +196,10 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
{
// there is an second operand acceptable
- type2 = pStk->GivTypResult(); // what kind of results?
+ type2 = pStk->GetTypResult(); // what kind of results?
// what kind of result?
- int TypeRes = MAX( type1.GivType(3), type2.GivType(3) );
+ int TypeRes = MAX( type1.GetType(3), type2.GetType(3) );
if ( TypeOp == ID_ADD && type1.Eq(CBotTypString) )
{
TypeRes = CBotTypString;
@@ -232,17 +232,17 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
inst->m_leftop = left;
// special for evaluation of the operations of the same level from left to right
- while ( IsInList( p->GivType(), pOperations, typemasque ) ) // same operation(s) follows?
+ while ( IsInList( p->GetType(), pOperations, typemasque ) ) // same operation(s) follows?
{
- TypeOp = p->GivType();
+ TypeOp = p->GetType();
CBotTwoOpExpr* i = new CBotTwoOpExpr(); // element for operation
i->SetToken(p); // stores the operation
i->m_leftop = inst; // left operand
type1 = TypeRes;
- p = p->GivNext(); // advance after
+ p = p->GetNext(); // advance after
i->m_rightop = CBotTwoOpExpr::Compile( p, pStk, pOp );
- type2 = pStk->GivTypResult();
+ type2 = pStk->GetTypResult();
if ( !TypeCompatible (type1, type2, TypeOp) ) // the results are compatible
{
@@ -252,7 +252,7 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
}
if ( TypeRes != CBotTypString )
- TypeRes = MAX(type1.GivType(), type2.GivType());
+ TypeRes = MAX(type1.GetType(), type2.GetType());
inst = i;
}
@@ -283,7 +283,7 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera
bool IsNan(CBotVar* left, CBotVar* right, int* err = NULL)
{
- if ( left ->GivInit() > IS_DEF || right->GivInit() > IS_DEF )
+ if ( left ->GetInit() > IS_DEF || right->GetInit() > IS_DEF )
{
if ( err != NULL ) *err = TX_OPNAN ;
return true;
@@ -302,19 +302,19 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
// according to recovery, it may be in one of two states
- if ( pStk1->GivState() == 0 ) // first state, evaluates the left operand
+ if ( pStk1->GetState() == 0 ) // first state, evaluates the left operand
{
if (!m_leftop->Execute(pStk1) ) return false; // interrupted here?
// for OR and AND logic does not evaluate the second expression if not necessary
- if ( (GivTokenType() == ID_LOG_AND || GivTokenType() == ID_TXT_AND ) && pStk1->GivVal() == false )
+ if ( (GetTokenType() == ID_LOG_AND || GetTokenType() == ID_TXT_AND ) && pStk1->GetVal() == false )
{
CBotVar* res = CBotVar::Create( (CBotToken*)NULL, CBotTypBoolean);
res->SetValInt(false);
pStk1->SetVar(res);
return pStack->Return(pStk1); // transmits the result
}
- if ( (GivTokenType() == ID_LOG_OR||GivTokenType() == ID_TXT_OR) && pStk1->GivVal() == true )
+ if ( (GetTokenType() == ID_LOG_OR||GetTokenType() == ID_TXT_OR) && pStk1->GetVal() == true )
{
CBotVar* res = CBotVar::Create( (CBotToken*)NULL, CBotTypBoolean);
res->SetValInt(true);
@@ -334,28 +334,28 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
// or return in case of recovery
// 2e état, évalue l'opérande de droite
- if ( pStk2->GivState() == 0 )
+ if ( pStk2->GetState() == 0 )
{
if ( !m_rightop->Execute(pStk2) ) return false; // interrupted here?
pStk2->IncState();
}
- CBotTypResult type1 = pStk1->GivTypResult(); // what kind of results?
- CBotTypResult type2 = pStk2->GivTypResult();
+ CBotTypResult type1 = pStk1->GetTypResult(); // what kind of results?
+ CBotTypResult type2 = pStk2->GetTypResult();
CBotStack* pStk3 = pStk2->AddStack(this); // adds an item to the stack
if ( pStk3->IfStep() ) return false; // shows the operation if step by step
// creates a temporary variable to put the result
// what kind of result?
- int TypeRes = MAX(type1.GivType(), type2.GivType());
+ int TypeRes = MAX(type1.GetType(), type2.GetType());
- if ( GivTokenType() == ID_ADD && type1.Eq(CBotTypString) )
+ if ( GetTokenType() == ID_ADD && type1.Eq(CBotTypString) )
{
TypeRes = CBotTypString;
}
- switch ( GivTokenType() )
+ switch ( GetTokenType() )
{
case ID_LOG_OR:
case ID_LOG_AND:
@@ -377,9 +377,9 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
CBotVar* result = CBotVar::Create( (CBotToken*)NULL, TypeRes);
// creates a variable to perform the calculation in the appropriate type
- TypeRes = MAX(type1.GivType(), type2.GivType());
+ TypeRes = MAX(type1.GetType(), type2.GetType());
- if ( GivTokenType() == ID_ADD && type1.Eq(CBotTypString) )
+ if ( GetTokenType() == ID_ADD && type1.Eq(CBotTypString) )
{
TypeRes = CBotTypString;
}
@@ -387,15 +387,15 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
CBotVar* temp;
if ( TypeRes == CBotTypPointer ) TypeRes = CBotTypNullPointer;
- if ( TypeRes == CBotTypClass ) temp = CBotVar::Create( (CBotToken*)NULL, CBotTypResult(CBotTypIntrinsic, type1.GivClass() ) );
+ if ( TypeRes == CBotTypClass ) temp = CBotVar::Create( (CBotToken*)NULL, CBotTypResult(CBotTypIntrinsic, type1.GetClass() ) );
else temp = CBotVar::Create( (CBotToken*)NULL, TypeRes );
int err = 0;
// is a operation according to request
- CBotVar* left = pStk1->GivVar();
- CBotVar* right = pStk2->GivVar();
+ CBotVar* left = pStk1->GetVar();
+ CBotVar* right = pStk2->GetVar();
- switch (GivTokenType())
+ switch (GetTokenType())
{
case ID_ADD:
if ( !IsNan(left, right, &err) ) result->Add(left , right); // addition
@@ -433,13 +433,13 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack)
break;
case ID_EQ:
if ( IsNan(left, right) )
- result->SetValInt(left->GivInit() == right->GivInit()) ;
+ result->SetValInt(left->GetInit() == right->GetInit()) ;
else
result->SetValInt(temp->Eq(left , right)); // equal
break;
case ID_NE:
if ( IsNan(left, right) )
- result->SetValInt(left ->GivInit() != right->GivInit()) ;
+ result->SetValInt(left ->GetInit() != right->GetInit()) ;
else
result->SetValInt(temp->Ne(left , right)); // different
break;
@@ -485,7 +485,7 @@ void CBotTwoOpExpr::RestoreState(CBotStack* &pStack, bool bMain)
// according to recovery, it may be in one of two states
- if ( pStk1->GivState() == 0 ) // first state, evaluates the left operand
+ if ( pStk1->GetState() == 0 ) // first state, evaluates the left operand
{
m_leftop->RestoreState(pStk1, bMain); // interrupted here!
return;
@@ -495,7 +495,7 @@ void CBotTwoOpExpr::RestoreState(CBotStack* &pStack, bool bMain)
if ( pStk2 == NULL ) return;
// second state, evaluates the right operand
- if ( pStk2->GivState() == 0 )
+ if ( pStk2->GetState() == 0 )
{
m_rightop->RestoreState(pStk2, bMain); // interrupted here!
return;
@@ -509,13 +509,13 @@ bool CBotLogicExpr::Execute(CBotStack* &pStack)
// or return in case of recovery
// if ( pStk1 == EOX ) return true;
- if ( pStk1->GivState() == 0 )
+ if ( pStk1->GetState() == 0 )
{
if ( !m_condition->Execute(pStk1) ) return false;
if (!pStk1->SetState(1)) return false;
}
- if ( pStk1->GivVal() == true )
+ if ( pStk1->GetVal() == true )
{
if ( !m_op1->Execute(pStk1) ) return false;
}
@@ -534,13 +534,13 @@ void CBotLogicExpr::RestoreState(CBotStack* &pStack, bool bMain)
CBotStack* pStk1 = pStack->RestoreStack(this); // adds an item to the stack
if ( pStk1 == NULL ) return;
- if ( pStk1->GivState() == 0 )
+ if ( pStk1->GetState() == 0 )
{
m_condition->RestoreState(pStk1, bMain);
return;
}
- if ( pStk1->GivVal() == true )
+ if ( pStk1->GetVal() == true )
{
m_op1->RestoreState(pStk1, bMain);
}
diff --git a/src/CBot/CBotVar.cpp b/src/CBot/CBotVar.cpp
index 0d9bfb3..42f807a 100644
--- a/src/CBot/CBotVar.cpp
+++ b/src/CBot/CBotVar.cpp
@@ -154,12 +154,12 @@ void CBotVarClass::InitCBotVarClass( const CBotToken* name, CBotTypResult& type
m_ExPrev = NULL;
m_ExClass = this;
- CBotClass* pClass = type.GivClass();
- CBotClass* pClass2 = pClass->GivParent();
+ CBotClass* pClass = type.GetClass();
+ CBotClass* pClass2 = pClass->GetParent();
if ( pClass2 != NULL )
{
// also creates an instance of the parent class
- m_pParent = new CBotVarClass(name, CBotTypResult(type.GivType(),pClass2) ); //, nIdent);
+ m_pParent = new CBotVarClass(name, CBotTypResult(type.GetType(),pClass2) ); //, nIdent);
}
SetClass( pClass ); //, nIdent );
@@ -203,8 +203,8 @@ CBotVar::~CBotVar( )
void CBotVar::debug()
{
- const char* p = (const char*) m_token->GivString();
- CBotString s = (const char*) GivValString();
+ const char* p = (const char*) m_token->GetString();
+ CBotString s = (const char*) GetValString();
const char* v = (const char*) s;
if ( m_type.Eq(CBotTypClass) )
@@ -213,7 +213,7 @@ void CBotVar::debug()
while (pv != NULL)
{
pv->debug();
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
}
}
@@ -251,13 +251,13 @@ long CBotVar::NextUniqNum()
return m_identcpt;
}
-long CBotVar::GivUniqNum()
+long CBotVar::GetUniqNum()
{
return m_ident;
}
-void* CBotVar::GivUserPtr()
+void* CBotVar::GetUserPtr()
{
return m_pUserPtr;
}
@@ -288,7 +288,7 @@ CBotVar* CBotVar::Create(const CBotToken* name, int type )
CBotVar* CBotVar::Create(const CBotToken* name, CBotTypResult type)
{
- switch (type.GivType())
+ switch (type.GetType())
{
case CBotTypShort:
case CBotTypInt:
@@ -327,8 +327,8 @@ CBotVar* CBotVar::Create(const CBotToken* name, CBotTypResult type)
CBotVar* pv = array;
while (type.Eq(CBotTypArrayBody))
{
- type = type.GivTypElem();
- pv = ((CBotVarArray*)pv)->GivItem(0, true); // creates at least the element [0]
+ type = type.GetTypElem();
+ pv = ((CBotVarArray*)pv)->GetItem(0, true); // creates at least the element [0]
}
return array;
@@ -341,7 +341,7 @@ CBotVar* CBotVar::Create(const CBotToken* name, CBotTypResult type)
CBotVar* CBotVar::Create( CBotVar* pVar )
{
- CBotVar* p = Create(pVar->m_token->GivString(), pVar->GivTypResult(2));
+ CBotVar* p = Create(pVar->m_token->GetString(), pVar->GetTypResult(2));
return p;
}
@@ -350,7 +350,7 @@ CBotVar* CBotVar::Create( const char* n, CBotTypResult type)
{
CBotToken name(n);
- switch (type.GivType())
+ switch (type.GetType())
{
case CBotTypShort:
case CBotTypInt:
@@ -365,13 +365,13 @@ CBotVar* CBotVar::Create( const char* n, CBotTypResult type)
case CBotTypNullPointer:
{
CBotVarPointer* p = new CBotVarPointer(&name, type);
-// p->SetClass(type.GivClass());
+// p->SetClass(type.GetClass());
return p;
}
case CBotTypIntrinsic:
{
CBotVarClass* p = new CBotVarClass(&name, type);
-// p->SetClass(type.GivClass());
+// p->SetClass(type.GetClass());
return p;
}
@@ -382,7 +382,7 @@ CBotVar* CBotVar::Create( const char* n, CBotTypResult type)
CBotVarClass* instance = new CBotVarClass(&name, type);
CBotVarPointer* pointer = new CBotVarPointer(&name, type);
pointer->SetPointer( instance );
-// pointer->SetClass( type.GivClass() );
+// pointer->SetClass( type.GetClass() );
return pointer;
}
@@ -398,8 +398,8 @@ CBotVar* CBotVar::Create( const char* n, CBotTypResult type)
CBotVar* pv = array;
while (type.Eq(CBotTypArrayBody))
{
- type = type.GivTypElem();
- pv = ((CBotVarArray*)pv)->GivItem(0, true); // creates at least the element [0]
+ type = type.GetTypElem();
+ pv = ((CBotVarArray*)pv)->GetItem(0, true); // creates at least the element [0]
}
return array;
@@ -439,7 +439,7 @@ CBotVar* CBotVar::Create( const char* name, CBotClass* pClass)
return pVar;
}
-CBotTypResult CBotVar::GivTypResult(int mode)
+CBotTypResult CBotVar::GetTypResult(int mode)
{
CBotTypResult r = m_type;
@@ -451,13 +451,13 @@ CBotTypResult CBotVar::GivTypResult(int mode)
return r;
}
-int CBotVar::GivType(int mode)
+int CBotVar::GetType(int mode)
{
if ( mode == 1 && m_type.Eq(CBotTypClass) )
return CBotTypPointer;
if ( mode == 2 && m_type.Eq(CBotTypClass) )
return CBotTypIntrinsic;
- return m_type.GivType();
+ return m_type.GetType();
}
void CBotVar::SetType(CBotTypResult& type)
@@ -466,7 +466,7 @@ void CBotVar::SetType(CBotTypResult& type)
}
-int CBotVar::GivInit()
+int CBotVar::GetInit()
{
if ( m_type.Eq(CBotTypClass) ) return IS_DEF; // always set!
@@ -480,7 +480,7 @@ void CBotVar::SetInit(int bInit)
if ( m_type.Eq(CBotTypPointer) && bInit == 2 )
{
- CBotVarClass* instance = GivPointer();
+ CBotVarClass* instance = GetPointer();
if ( instance == NULL )
{
instance = new CBotVarClass(NULL, m_type);
@@ -497,14 +497,14 @@ void CBotVar::SetInit(int bInit)
{
p->SetInit( bInit );
p->m_pMyThis = (CBotVarClass*)this;
- p = p->GivNext();
+ p = p->GetNext();
}
}
}
-CBotString CBotVar::GivName()
+CBotString CBotVar::GetName()
{
- return m_token->GivString();
+ return m_token->GetString();
}
void CBotVar::SetName(const char* name)
@@ -512,30 +512,30 @@ void CBotVar::SetName(const char* name)
m_token->SetString(name);
}
-CBotToken* CBotVar::GivToken()
+CBotToken* CBotVar::GetToken()
{
return m_token;
}
-CBotVar* CBotVar::GivItem(const char* name)
+CBotVar* CBotVar::GetItem(const char* name)
{
ASM_TRAP();
return NULL;
}
-CBotVar* CBotVar::GivItemRef(int nIdent)
+CBotVar* CBotVar::GetItemRef(int nIdent)
{
ASM_TRAP();
return NULL;
}
-CBotVar* CBotVar::GivItemList()
+CBotVar* CBotVar::GetItemList()
{
ASM_TRAP();
return NULL;
}
-CBotVar* CBotVar::GivItem(int row, bool bGrow)
+CBotVar* CBotVar::GetItem(int row, bool bGrow)
{
ASM_TRAP();
return NULL;
@@ -557,25 +557,25 @@ bool CBotVar::IsElemOfClass(const char* name)
while ( pc != NULL )
{
- if ( pc->GivName() == name ) return true;
- pc = pc->GivParent();
+ if ( pc->GetName() == name ) return true;
+ pc = pc->GetParent();
}
return false;
}
-CBotVar* CBotVar::GivStaticVar()
+CBotVar* CBotVar::GetStaticVar()
{
// makes the pointer to the variable if it is static
if ( m_bStatic == 0 || m_pMyThis == NULL ) return this;
- CBotClass* pClass = m_pMyThis->GivClass();
- return pClass->GivItem( m_token->GivString() );
+ CBotClass* pClass = m_pMyThis->GetClass();
+ return pClass->GetItem( m_token->GetString() );
}
-CBotVar* CBotVar::GivNext()
+CBotVar* CBotVar::GetNext()
{
return m_next;
}
@@ -590,24 +590,24 @@ void CBotVar::AddNext(CBotVar* pVar)
void CBotVar::SetVal(CBotVar* var)
{
- switch (/*var->*/GivType())
+ switch (/*var->*/GetType())
{
case CBotTypBoolean:
- SetValInt(var->GivValInt());
+ SetValInt(var->GetValInt());
break;
case CBotTypInt:
- SetValInt(var->GivValInt(), ((CBotVarInt*)var)->m_defnum);
+ SetValInt(var->GetValInt(), ((CBotVarInt*)var)->m_defnum);
break;
case CBotTypFloat:
- SetValFloat(var->GivValFloat());
+ SetValFloat(var->GetValFloat());
break;
case CBotTypString:
- SetValString(var->GivValString());
+ SetValString(var->GetValString());
break;
case CBotTypPointer:
case CBotTypNullPointer:
case CBotTypArrayPointer:
- SetPointer(var->GivPointer());
+ SetPointer(var->GetPointer());
break;
case CBotTypClass:
{
@@ -643,7 +643,7 @@ bool CBotVar::IsPrivate(int mode)
return m_mPrivate >= mode;
}
-int CBotVar::GivPrivate()
+int CBotVar::GetPrivate()
{
return m_mPrivate;
}
@@ -654,7 +654,7 @@ void CBotVar::SetPointer(CBotVar* pVarClass)
ASM_TRAP();
}
-CBotVarClass* CBotVar::GivPointer()
+CBotVarClass* CBotVar::GetPointer()
{
ASM_TRAP();
return NULL;
@@ -663,13 +663,13 @@ CBotVarClass* CBotVar::GivPointer()
// All these functions must be defined in the subclasses
// derived from class CBotVar
-int CBotVar::GivValInt()
+int CBotVar::GetValInt()
{
ASM_TRAP();
return 0;
}
-float CBotVar::GivValFloat()
+float CBotVar::GetValFloat()
{
ASM_TRAP();
return 0;
@@ -812,7 +812,7 @@ void CBotVar::SetValString(const char* p)
ASM_TRAP();
}
-CBotString CBotVar::GivValString()
+CBotString CBotVar::GetValString()
{
ASM_TRAP();
return CBotString();
@@ -823,7 +823,7 @@ void CBotVar::SetClass(CBotClass* pClass)
ASM_TRAP();
}
-CBotClass* CBotVar::GivClass()
+CBotClass* CBotVar::GetClass()
{
ASM_TRAP();
return NULL;
@@ -874,17 +874,17 @@ void CBotVarInt::SetValFloat(float val)
m_binit = true;
}
-int CBotVarInt::GivValInt()
+int CBotVarInt::GetValInt()
{
return m_val;
}
-float CBotVarInt::GivValFloat()
+float CBotVarInt::GetValFloat()
{
return (float)m_val;
}
-CBotString CBotVarInt::GivValString()
+CBotString CBotVarInt::GetValString()
{
if ( !m_defnum.IsEmpty() ) return m_defnum;
@@ -911,22 +911,22 @@ CBotString CBotVarInt::GivValString()
void CBotVarInt::Mul(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() * right->GivValInt();
+ m_val = left->GetValInt() * right->GetValInt();
m_binit = true;
}
void CBotVarInt::Power(CBotVar* left, CBotVar* right)
{
- m_val = (int) pow( (double) left->GivValInt() , (double) right->GivValInt() );
+ m_val = (int) pow( (double) left->GetValInt() , (double) right->GetValInt() );
m_binit = true;
}
int CBotVarInt::Div(CBotVar* left, CBotVar* right)
{
- int r = right->GivValInt();
+ int r = right->GetValInt();
if ( r != 0 )
{
- m_val = left->GivValInt() / r;
+ m_val = left->GetValInt() / r;
m_binit = true;
}
return ( r == 0 ? TX_DIVZERO : 0 );
@@ -934,10 +934,10 @@ int CBotVarInt::Div(CBotVar* left, CBotVar* right)
int CBotVarInt::Modulo(CBotVar* left, CBotVar* right)
{
- int r = right->GivValInt();
+ int r = right->GetValInt();
if ( r != 0 )
{
- m_val = left->GivValInt() % r;
+ m_val = left->GetValInt() % r;
m_binit = true;
}
return ( r == 0 ? TX_DIVZERO : 0 );
@@ -945,50 +945,50 @@ int CBotVarInt::Modulo(CBotVar* left, CBotVar* right)
void CBotVarInt::Add(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() + right->GivValInt();
+ m_val = left->GetValInt() + right->GetValInt();
m_binit = true;
}
void CBotVarInt::Sub(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() - right->GivValInt();
+ m_val = left->GetValInt() - right->GetValInt();
m_binit = true;
}
void CBotVarInt::XOr(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() ^ right->GivValInt();
+ m_val = left->GetValInt() ^ right->GetValInt();
m_binit = true;
}
void CBotVarInt::And(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() & right->GivValInt();
+ m_val = left->GetValInt() & right->GetValInt();
m_binit = true;
}
void CBotVarInt::Or(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() | right->GivValInt();
+ m_val = left->GetValInt() | right->GetValInt();
m_binit = true;
}
void CBotVarInt::SL(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() << right->GivValInt();
+ m_val = left->GetValInt() << right->GetValInt();
m_binit = true;
}
void CBotVarInt::ASR(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() >> right->GivValInt();
+ m_val = left->GetValInt() >> right->GetValInt();
m_binit = true;
}
void CBotVarInt::SR(CBotVar* left, CBotVar* right)
{
- int source = left->GivValInt();
- int shift = right->GivValInt();
+ int source = left->GetValInt();
+ int shift = right->GetValInt();
if (shift>=1) source &= 0x7fffffff;
m_val = source >> shift;
m_binit = true;
@@ -1018,32 +1018,32 @@ void CBotVarInt::Dec()
bool CBotVarInt::Lo(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() < right->GivValInt();
+ return left->GetValInt() < right->GetValInt();
}
bool CBotVarInt::Hi(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() > right->GivValInt();
+ return left->GetValInt() > right->GetValInt();
}
bool CBotVarInt::Ls(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() <= right->GivValInt();
+ return left->GetValInt() <= right->GetValInt();
}
bool CBotVarInt::Hs(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() >= right->GivValInt();
+ return left->GetValInt() >= right->GetValInt();
}
bool CBotVarInt::Eq(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() == right->GivValInt();
+ return left->GetValInt() == right->GetValInt();
}
bool CBotVarInt::Ne(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() != right->GivValInt();
+ return left->GetValInt() != right->GetValInt();
}
@@ -1082,17 +1082,17 @@ void CBotVarFloat::SetValFloat(float val)
m_binit = true;
}
-int CBotVarFloat::GivValInt()
+int CBotVarFloat::GetValInt()
{
return (int)m_val;
}
-float CBotVarFloat::GivValFloat()
+float CBotVarFloat::GetValFloat()
{
return m_val;
}
-CBotString CBotVarFloat::GivValString()
+CBotString CBotVarFloat::GetValString()
{
CBotString res;
@@ -1117,22 +1117,22 @@ CBotString CBotVarFloat::GivValString()
void CBotVarFloat::Mul(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValFloat() * right->GivValFloat();
+ m_val = left->GetValFloat() * right->GetValFloat();
m_binit = true;
}
void CBotVarFloat::Power(CBotVar* left, CBotVar* right)
{
- m_val = (float)pow( left->GivValFloat() , right->GivValFloat() );
+ m_val = (float)pow( left->GetValFloat() , right->GetValFloat() );
m_binit = true;
}
int CBotVarFloat::Div(CBotVar* left, CBotVar* right)
{
- float r = right->GivValFloat();
+ float r = right->GetValFloat();
if ( r != 0 )
{
- m_val = left->GivValFloat() / r;
+ m_val = left->GetValFloat() / r;
m_binit = true;
}
return ( r == 0 ? TX_DIVZERO : 0 );
@@ -1140,10 +1140,10 @@ int CBotVarFloat::Div(CBotVar* left, CBotVar* right)
int CBotVarFloat::Modulo(CBotVar* left, CBotVar* right)
{
- float r = right->GivValFloat();
+ float r = right->GetValFloat();
if ( r != 0 )
{
- m_val = (float)fmod( left->GivValFloat() , r );
+ m_val = (float)fmod( left->GetValFloat() , r );
m_binit = true;
}
return ( r == 0 ? TX_DIVZERO : 0 );
@@ -1151,13 +1151,13 @@ int CBotVarFloat::Modulo(CBotVar* left, CBotVar* right)
void CBotVarFloat::Add(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValFloat() + right->GivValFloat();
+ m_val = left->GetValFloat() + right->GetValFloat();
m_binit = true;
}
void CBotVarFloat::Sub(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValFloat() - right->GivValFloat();
+ m_val = left->GetValFloat() - right->GetValFloat();
m_binit = true;
}
@@ -1179,32 +1179,32 @@ void CBotVarFloat::Dec()
bool CBotVarFloat::Lo(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() < right->GivValFloat();
+ return left->GetValFloat() < right->GetValFloat();
}
bool CBotVarFloat::Hi(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() > right->GivValFloat();
+ return left->GetValFloat() > right->GetValFloat();
}
bool CBotVarFloat::Ls(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() <= right->GivValFloat();
+ return left->GetValFloat() <= right->GetValFloat();
}
bool CBotVarFloat::Hs(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() >= right->GivValFloat();
+ return left->GetValFloat() >= right->GetValFloat();
}
bool CBotVarFloat::Eq(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() == right->GivValFloat();
+ return left->GetValFloat() == right->GetValFloat();
}
bool CBotVarFloat::Ne(CBotVar* left, CBotVar* right)
{
- return left->GivValFloat() != right->GivValFloat();
+ return left->GetValFloat() != right->GetValFloat();
}
@@ -1243,17 +1243,17 @@ void CBotVarBoolean::SetValFloat(float val)
m_binit = true;
}
-int CBotVarBoolean::GivValInt()
+int CBotVarBoolean::GetValInt()
{
return m_val;
}
-float CBotVarBoolean::GivValFloat()
+float CBotVarBoolean::GetValFloat()
{
return (float)m_val;
}
-CBotString CBotVarBoolean::GivValString()
+CBotString CBotVarBoolean::GetValString()
{
CBotString ret;
@@ -1276,18 +1276,18 @@ CBotString CBotVarBoolean::GivValString()
void CBotVarBoolean::And(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() && right->GivValInt();
+ m_val = left->GetValInt() && right->GetValInt();
m_binit = true;
}
void CBotVarBoolean::Or(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() || right->GivValInt();
+ m_val = left->GetValInt() || right->GetValInt();
m_binit = true;
}
void CBotVarBoolean::XOr(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValInt() ^ right->GivValInt();
+ m_val = left->GetValInt() ^ right->GetValInt();
m_binit = true;
}
@@ -1298,12 +1298,12 @@ void CBotVarBoolean::Not()
bool CBotVarBoolean::Eq(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() == right->GivValInt();
+ return left->GetValInt() == right->GetValInt();
}
bool CBotVarBoolean::Ne(CBotVar* left, CBotVar* right)
{
- return left->GivValInt() != right->GivValInt();
+ return left->GetValInt() != right->GetValInt();
}
//////////////////////////////////////////////////////////////////////////////////////
@@ -1333,7 +1333,7 @@ void CBotVarString::SetValString(const char* p)
m_binit = true;
}
-CBotString CBotVarString::GivValString()
+CBotString CBotVarString::GetValString()
{
if ( !m_binit )
{
@@ -1354,39 +1354,39 @@ CBotString CBotVarString::GivValString()
void CBotVarString::Add(CBotVar* left, CBotVar* right)
{
- m_val = left->GivValString() + right->GivValString();
+ m_val = left->GetValString() + right->GetValString();
m_binit = true;
}
bool CBotVarString::Eq(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() == right->GivValString());
+ return (left->GetValString() == right->GetValString());
}
bool CBotVarString::Ne(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() != right->GivValString());
+ return (left->GetValString() != right->GetValString());
}
bool CBotVarString::Lo(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() == right->GivValString());
+ return (left->GetValString() == right->GetValString());
}
bool CBotVarString::Hi(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() == right->GivValString());
+ return (left->GetValString() == right->GetValString());
}
bool CBotVarString::Ls(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() == right->GivValString());
+ return (left->GetValString() == right->GetValString());
}
bool CBotVarString::Hs(CBotVar* left, CBotVar* right)
{
- return (left->GivValString() == right->GivValString());
+ return (left->GetValString() == right->GetValString());
}
@@ -1395,9 +1395,9 @@ bool CBotVarString::Hs(CBotVar* left, CBotVar* right)
// copy a variable into another
void CBotVarClass::Copy(CBotVar* pSrc, bool bName)
{
- pSrc = pSrc->GivPointer(); // if source given by a pointer
+ pSrc = pSrc->GetPointer(); // if source given by a pointer
- if ( pSrc->GivType() != CBotTypClass )
+ if ( pSrc->GetType() != CBotTypClass )
ASM_TRAP();
CBotVarClass* p = (CBotVarClass*)pSrc;
@@ -1432,7 +1432,7 @@ void CBotVarClass::Copy(CBotVar* pSrc, bool bName)
if ( m_pVar == NULL ) m_pVar = pn;
else m_pVar->AddNext(pn);
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
}
@@ -1461,7 +1461,7 @@ void CBotVarClass::SetClass(CBotClass* pClass)//, int &nIdent)
if (pClass == NULL) return;
- CBotVar* pv = pClass->GivVar(); // first on a list
+ CBotVar* pv = pClass->GetVar(); // first on a list
while ( pv != NULL )
{
// seeks the maximum dimensions of the table
@@ -1475,10 +1475,10 @@ void CBotVarClass::SetClass(CBotClass* pClass)//, int &nIdent)
while (p != NULL)
{
while( pile->IsOk() && !p->Execute(pile) ) ; // calculate size without interruptions
- CBotVar* v = pile->GivVar(); // result
- max[n] = v->GivValInt(); // value
+ CBotVar* v = pile->GetVar(); // result
+ max[n] = v->GetValInt(); // value
n++;
- p = p->GivNext3();
+ p = p->GetNext3();
}
while (n<100) max[n++] = 0;
@@ -1488,7 +1488,7 @@ void CBotVarClass::SetClass(CBotClass* pClass)//, int &nIdent)
CBotVar* pn = CBotVar::Create( pv ); // a copy
pn->SetStatic(pv->IsStatic());
- pn->SetPrivate(pv->GivPrivate());
+ pn->SetPrivate(pv->GetPrivate());
if ( pv->m_InitExpr != NULL ) // expression for initialization?
{
@@ -1501,22 +1501,22 @@ void CBotVarClass::SetClass(CBotClass* pClass)//, int &nIdent)
#else
CBotStack* pile = new CBotStack(NULL); // an independent stack
while(!pv->m_InitExpr->Execute(pile)); // evaluates the expression without timer
- pn->SetVal( pile->GivVar() ) ;
+ pn->SetVal( pile->GetVar() ) ;
delete pile;
#endif
}
// pn->SetUniqNum(CBotVar::NextUniqNum()); // enumerate elements
- pn->SetUniqNum(pv->GivUniqNum()); //++nIdent
+ pn->SetUniqNum(pv->GetUniqNum()); //++nIdent
pn->m_pMyThis = this;
if ( m_pVar == NULL) m_pVar = pn;
else m_pVar->AddNext( pn );
- pv = pv->GivNext();
+ pv = pv->GetNext();
}
}
-CBotClass* CBotVarClass::GivClass()
+CBotClass* CBotVarClass::GetClass()
{
return m_pClass;
}
@@ -1540,49 +1540,49 @@ void CBotVarClass::Maj(void* pUser, bool bContinu)
m_pClass->m_rMaj( this, pUser );
}
-CBotVar* CBotVarClass::GivItem(const char* name)
+CBotVar* CBotVarClass::GetItem(const char* name)
{
CBotVar* p = m_pVar;
while ( p != NULL )
{
- if ( p->GivName() == name ) return p;
- p = p->GivNext();
+ if ( p->GetName() == name ) return p;
+ p = p->GetNext();
}
- if ( m_pParent != NULL ) return m_pParent->GivItem(name);
+ if ( m_pParent != NULL ) return m_pParent->GetItem(name);
return NULL;
}
-CBotVar* CBotVarClass::GivItemRef(int nIdent)
+CBotVar* CBotVarClass::GetItemRef(int nIdent)
{
CBotVar* p = m_pVar;
while ( p != NULL )
{
- if ( p->GivUniqNum() == nIdent ) return p;
- p = p->GivNext();
+ if ( p->GetUniqNum() == nIdent ) return p;
+ p = p->GetNext();
}
- if ( m_pParent != NULL ) return m_pParent->GivItemRef(nIdent);
+ if ( m_pParent != NULL ) return m_pParent->GetItemRef(nIdent);
return NULL;
}
// for the management of an array
// bExtend can enlarge the table, but not beyond the threshold size of SetArray ()
-CBotVar* CBotVarClass::GivItem(int n, bool bExtend)
+CBotVar* CBotVarClass::GetItem(int n, bool bExtend)
{
CBotVar* p = m_pVar;
if ( n < 0 ) return NULL;
if ( n > MAXARRAYSIZE ) return NULL;
- if ( m_type.GivLimite() >= 0 && n >= m_type.GivLimite() ) return NULL;
+ if ( m_type.GetLimite() >= 0 && n >= m_type.GetLimite() ) return NULL;
if ( p == NULL && bExtend )
{
- p = CBotVar::Create("", m_type.GivTypElem());
+ p = CBotVar::Create("", m_type.GetTypElem());
m_pVar = p;
}
@@ -1592,7 +1592,7 @@ CBotVar* CBotVarClass::GivItem(int n, bool bExtend)
{
if ( p->m_next == NULL )
{
- if ( bExtend ) p->m_next = CBotVar::Create("", m_type.GivTypElem());
+ if ( bExtend ) p->m_next = CBotVar::Create("", m_type.GetTypElem());
if ( p->m_next == NULL ) return NULL;
}
p = p->m_next;
@@ -1601,21 +1601,21 @@ CBotVar* CBotVarClass::GivItem(int n, bool bExtend)
return p;
}
-CBotVar* CBotVarClass::GivItemList()
+CBotVar* CBotVarClass::GetItemList()
{
return m_pVar;
}
-CBotString CBotVarClass::GivValString()
+CBotString CBotVarClass::GetValString()
{
-// if ( m_Indirect != NULL) return m_Indirect->GivValString();
+// if ( m_Indirect != NULL) return m_Indirect->GetValString();
CBotString res;
if ( m_pClass != NULL ) // not used for an array
{
- res = m_pClass->GivName() + CBotString("( ");
+ res = m_pClass->GetName() + CBotString("( ");
CBotVarClass* my = this;
while ( my != NULL )
@@ -1623,25 +1623,25 @@ CBotString CBotVarClass::GivValString()
CBotVar* pv = my->m_pVar;
while ( pv != NULL )
{
- res += pv->GivName() + CBotString("=");
+ res += pv->GetName() + CBotString("=");
if ( pv->IsStatic() )
{
- CBotVar* pvv = my->m_pClass->GivItem(pv->GivName());
- res += pvv->GivValString();
+ CBotVar* pvv = my->m_pClass->GetItem(pv->GetName());
+ res += pvv->GetValString();
}
else
{
- res += pv->GivValString();
+ res += pv->GetValString();
}
- pv = pv->GivNext();
+ pv = pv->GetNext();
if ( pv != NULL ) res += ", ";
}
my = my->m_pParent;
if ( my != NULL )
{
res += ") extends ";
- res += my->m_pClass->GivName();
+ res += my->m_pClass->GetName();
res += " (";
}
}
@@ -1653,9 +1653,9 @@ CBotString CBotVarClass::GivValString()
CBotVar* pv = m_pVar;
while ( pv != NULL )
{
- res += pv->GivValString();
- if ( pv->GivNext() != NULL ) res += ", ";
- pv = pv->GivNext();
+ res += pv->GetValString();
+ if ( pv->GetNext() != NULL ) res += ", ";
+ pv = pv->GetNext();
}
}
@@ -1683,7 +1683,7 @@ void CBotVarClass::DecrementUse()
// saves the value for return
int err, start, end;
CBotStack* pile = NULL;
- err = pile->GivError(start,end); // stack == NULL it does not bother!
+ err = pile->GetError(start,end); // stack == NULL it does not bother!
pile = CBotStack::FirstStack(); // clears the error
CBotVar* ppVars[1];
@@ -1693,7 +1693,7 @@ void CBotVarClass::DecrementUse()
pThis->SetPointer(this);
CBotVar* pResult = NULL;
- CBotString nom = "~" + m_pClass->GivName();
+ CBotString nom = "~" + m_pClass->GetName();
long ident = 0;
while ( pile->IsOk() && !m_pClass->ExecuteMethode(ident, nom, pThis, ppVars, pResult, pile, NULL)) ; // waits for the end
@@ -1709,7 +1709,7 @@ void CBotVarClass::DecrementUse()
}
}
-CBotVarClass* CBotVarClass::GivPointer()
+CBotVarClass* CBotVarClass::GetPointer()
{
return this;
}
@@ -1732,14 +1732,14 @@ CBotVarClass* CBotVarClass::Find(long id)
bool CBotVarClass::Eq(CBotVar* left, CBotVar* right)
{
- CBotVar* l = left->GivItemList();
- CBotVar* r = right->GivItemList();
+ CBotVar* l = left->GetItemList();
+ CBotVar* r = right->GetItemList();
while ( l != NULL && r != NULL )
{
if ( l->Ne(l, r) ) return false;
- l = l->GivNext();
- r = r->GivNext();
+ l = l->GetNext();
+ r = r->GetNext();
}
// should always arrived simultaneously at the end (same classes)
@@ -1748,14 +1748,14 @@ bool CBotVarClass::Eq(CBotVar* left, CBotVar* right)
bool CBotVarClass::Ne(CBotVar* left, CBotVar* right)
{
- CBotVar* l = left->GivItemList();
- CBotVar* r = right->GivItemList();
+ CBotVar* l = left->GetItemList();
+ CBotVar* r = right->GetItemList();
while ( l != NULL && r != NULL )
{
if ( l->Ne(l, r) ) return true;
- l = l->GivNext();
- r = r->GivNext();
+ l = l->GetNext();
+ r = r->GetNext();
}
// should always arrived simultaneously at the end (same classes)
@@ -1790,14 +1790,14 @@ CBotVarArray::~CBotVarArray()
// copy a variable into another
void CBotVarArray::Copy(CBotVar* pSrc, bool bName)
{
- if ( pSrc->GivType() != CBotTypArrayPointer )
+ if ( pSrc->GetType() != CBotTypArrayPointer )
ASM_TRAP();
CBotVarArray* p = (CBotVarArray*)pSrc;
if ( bName) *m_token = *p->m_token;
m_type = p->m_type;
- m_pInstance = p->GivPointer();
+ m_pInstance = p->GetPointer();
if ( m_pInstance != NULL )
m_pInstance->IncrementUse(); // a reference increase
@@ -1820,8 +1820,8 @@ void CBotVarArray::SetPointer(CBotVar* pVarClass)
if ( pVarClass != NULL )
{
- if ( pVarClass->GivType() == CBotTypArrayPointer )
- pVarClass = pVarClass->GivPointer(); // the real pointer to the object
+ if ( pVarClass->GetType() == CBotTypArrayPointer )
+ pVarClass = pVarClass->GetPointer(); // the real pointer to the object
if ( !pVarClass->m_type.Eq(CBotTypClass) &&
!pVarClass->m_type.Eq(CBotTypArrayBody))
@@ -1835,13 +1835,13 @@ void CBotVarArray::SetPointer(CBotVar* pVarClass)
}
-CBotVarClass* CBotVarArray::GivPointer()
+CBotVarClass* CBotVarArray::GetPointer()
{
if ( m_pInstance == NULL ) return NULL;
- return m_pInstance->GivPointer();
+ return m_pInstance->GetPointer();
}
-CBotVar* CBotVarArray::GivItem(int n, bool bExtend)
+CBotVar* CBotVarArray::GetItem(int n, bool bExtend)
{
if ( m_pInstance == NULL )
{
@@ -1851,19 +1851,19 @@ CBotVar* CBotVarArray::GivItem(int n, bool bExtend)
CBotVarClass* instance = new CBotVarClass(NULL, m_type);
SetPointer( instance );
}
- return m_pInstance->GivItem(n, bExtend);
+ return m_pInstance->GetItem(n, bExtend);
}
-CBotVar* CBotVarArray::GivItemList()
+CBotVar* CBotVarArray::GetItemList()
{
if ( m_pInstance == NULL) return NULL;
- return m_pInstance->GivItemList();
+ return m_pInstance->GetItemList();
}
-CBotString CBotVarArray::GivValString()
+CBotString CBotVarArray::GetValString()
{
if ( m_pInstance == NULL ) return ( CBotString( "Null pointer" ) ) ;
- return m_pInstance->GivValString();
+ return m_pInstance->GetValString();
}
bool CBotVarArray::Save1State(FILE* pf)
@@ -1896,7 +1896,7 @@ CBotVarPointer::CBotVarPointer(const CBotToken* name, CBotTypResult& type )
m_pClass = NULL;
m_pVarClass = NULL; // will be defined by a SetPointer()
- SetClass(type.GivClass() );
+ SetClass(type.GetClass() );
}
CBotVarPointer::~CBotVarPointer()
@@ -1913,33 +1913,33 @@ void CBotVarPointer::Maj(void* pUser, bool bContinu)
if ( m_pVarClass != NULL) m_pVarClass->Maj(pUser, false);
}
-CBotVar* CBotVarPointer::GivItem(const char* name)
+CBotVar* CBotVarPointer::GetItem(const char* name)
{
if ( m_pVarClass == NULL) // no existing instance?
- return m_pClass->GivItem(name); // makes the pointer in the class itself
+ return m_pClass->GetItem(name); // makes the pointer in the class itself
- return m_pVarClass->GivItem(name);
+ return m_pVarClass->GetItem(name);
}
-CBotVar* CBotVarPointer::GivItemRef(int nIdent)
+CBotVar* CBotVarPointer::GetItemRef(int nIdent)
{
if ( m_pVarClass == NULL) // no existing instance?
- return m_pClass->GivItemRef(nIdent);// makes the pointer to the class itself
+ return m_pClass->GetItemRef(nIdent);// makes the pointer to the class itself
- return m_pVarClass->GivItemRef(nIdent);
+ return m_pVarClass->GetItemRef(nIdent);
}
-CBotVar* CBotVarPointer::GivItemList()
+CBotVar* CBotVarPointer::GetItemList()
{
if ( m_pVarClass == NULL) return NULL;
- return m_pVarClass->GivItemList();
+ return m_pVarClass->GetItemList();
}
-CBotString CBotVarPointer::GivValString()
+CBotString CBotVarPointer::GetValString()
{
CBotString s = "Pointer to ";
if ( m_pVarClass == NULL ) s = "Null pointer" ;
- else s += m_pVarClass->GivValString();
+ else s += m_pVarClass->GetValString();
return s;
}
@@ -1960,10 +1960,10 @@ void CBotVarPointer::SetPointer(CBotVar* pVarClass)
if ( pVarClass != NULL )
{
- if ( pVarClass->GivType() == CBotTypPointer )
- pVarClass = pVarClass->GivPointer(); // the real pointer to the object
+ if ( pVarClass->GetType() == CBotTypPointer )
+ pVarClass = pVarClass->GetPointer(); // the real pointer to the object
-// if ( pVarClass->GivType() != CBotTypClass )
+// if ( pVarClass->GetType() != CBotTypClass )
if ( !pVarClass->m_type.Eq(CBotTypClass) )
ASM_TRAP();
@@ -1978,10 +1978,10 @@ void CBotVarPointer::SetPointer(CBotVar* pVarClass)
}
-CBotVarClass* CBotVarPointer::GivPointer()
+CBotVarClass* CBotVarPointer::GetPointer()
{
if ( m_pVarClass == NULL ) return NULL;
- return m_pVarClass->GivPointer();
+ return m_pVarClass->GetPointer();
}
void CBotVarPointer::SetIdent(long n)
@@ -1990,7 +1990,7 @@ void CBotVarPointer::SetIdent(long n)
m_pVarClass->SetIdent( n );
}
-long CBotVarPointer::GivIdent()
+long CBotVarPointer::GetIdent()
{
if ( m_pVarClass == NULL ) return 0;
return m_pVarClass->m_ItemIdent;
@@ -2004,9 +2004,9 @@ void CBotVarPointer::SetClass(CBotClass* pClass)
if ( m_pVarClass != NULL ) m_pVarClass->SetClass(pClass); //, nIdent);
}
-CBotClass* CBotVarPointer::GivClass()
+CBotClass* CBotVarPointer::GetClass()
{
- if ( m_pVarClass != NULL ) return m_pVarClass->GivClass();
+ if ( m_pVarClass != NULL ) return m_pVarClass->GetClass();
return m_pClass;
}
@@ -2016,24 +2016,24 @@ bool CBotVarPointer::Save1State(FILE* pf)
{
if ( m_pClass )
{
- if (!WriteString(pf, m_pClass->GivName())) return false; // name of the class
+ if (!WriteString(pf, m_pClass->GetName())) return false; // name of the class
}
else
{
if (!WriteString(pf, "")) return false;
}
- if (!WriteLong(pf, GivIdent())) return false; // the unique reference
+ if (!WriteLong(pf, GetIdent())) return false; // the unique reference
// also saves the proceedings copies
- return SaveVar(pf, GivPointer());
+ return SaveVar(pf, GetPointer());
}
// copy a variable into another
void CBotVarPointer::Copy(CBotVar* pSrc, bool bName)
{
- if ( pSrc->GivType() != CBotTypPointer &&
- pSrc->GivType() != CBotTypNullPointer)
+ if ( pSrc->GetType() != CBotTypPointer &&
+ pSrc->GetType() != CBotTypNullPointer)
ASM_TRAP();
CBotVarPointer* p = (CBotVarPointer*)pSrc;
@@ -2041,7 +2041,7 @@ void CBotVarPointer::Copy(CBotVar* pSrc, bool bName)
if ( bName) *m_token = *p->m_token;
m_type = p->m_type;
// m_pVarClass = p->m_pVarClass;
- m_pVarClass = p->GivPointer();
+ m_pVarClass = p->GetPointer();
if ( m_pVarClass != NULL )
m_pVarClass->IncrementUse(); // incerement the reference
@@ -2059,23 +2059,23 @@ void CBotVarPointer::Copy(CBotVar* pSrc, bool bName)
bool CBotVarPointer::Eq(CBotVar* left, CBotVar* right)
{
- CBotVarClass* l = left->GivPointer();
- CBotVarClass* r = right->GivPointer();
+ CBotVarClass* l = left->GetPointer();
+ CBotVarClass* r = right->GetPointer();
if ( l == r ) return true;
- if ( l == NULL && r->GivUserPtr() == OBJECTDELETED ) return true;
- if ( r == NULL && l->GivUserPtr() == OBJECTDELETED ) return true;
+ if ( l == NULL && r->GetUserPtr() == OBJECTDELETED ) return true;
+ if ( r == NULL && l->GetUserPtr() == OBJECTDELETED ) return true;
return false;
}
bool CBotVarPointer::Ne(CBotVar* left, CBotVar* right)
{
- CBotVarClass* l = left->GivPointer();
- CBotVarClass* r = right->GivPointer();
+ CBotVarClass* l = left->GetPointer();
+ CBotVarClass* r = right->GetPointer();
if ( l == r ) return false;
- if ( l == NULL && r->GivUserPtr() == OBJECTDELETED ) return false;
- if ( r == NULL && l->GivUserPtr() == OBJECTDELETED ) return false;
+ if ( l == NULL && r->GetUserPtr() == OBJECTDELETED ) return false;
+ if ( r == NULL && l->GetUserPtr() == OBJECTDELETED ) return false;
return true;
}
@@ -2155,7 +2155,7 @@ CBotTypResult::~CBotTypResult()
delete m_pNext;
}
-int CBotTypResult::GivType(int mode) const
+int CBotTypResult::GetType(int mode) const
{
#ifdef _DEBUG
if ( m_type == CBotTypPointer ||
@@ -2177,17 +2177,17 @@ void CBotTypResult::SetType(int n)
m_type = n;
}
-CBotClass* CBotTypResult::GivClass() const
+CBotClass* CBotTypResult::GetClass() const
{
return m_pClass;
}
-CBotTypResult& CBotTypResult::GivTypElem() const
+CBotTypResult& CBotTypResult::GetTypElem() const
{
return *m_pNext;
}
-int CBotTypResult::GivLimite() const
+int CBotTypResult::GetLimite() const
{
return m_limite;
}
diff --git a/src/CBot/CBotWhile.cpp b/src/CBot/CBotWhile.cpp
index 51310a9..8a0cc64 100644
--- a/src/CBot/CBotWhile.cpp
+++ b/src/CBot/CBotWhile.cpp
@@ -55,7 +55,7 @@ CBotInstr* CBotWhile::Compile(CBotToken* &p, CBotCStack* pStack)
if ( IsOfType( p, TokenTypVar ) &&
IsOfType( p, ID_DOTS ) )
{
- inst->m_label = pp->GivString(); // records the name of the label
+ inst->m_label = pp->GetString(); // records the name of the label
}
inst->SetToken(p);
@@ -95,7 +95,7 @@ bool CBotWhile :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- while( true ) switch( pile->GivState() ) // executes the loop
+ while( true ) switch( pile->GetState() ) // executes the loop
{ // there are two possible states (depending on recovery)
case 0:
// evaluates the condition
@@ -104,7 +104,7 @@ bool CBotWhile :: Execute(CBotStack* &pj)
// the result of the condition is on the stack
// terminates if an error or if the condition is false
- if ( !pile->IsOk() || pile->GivVal() != true )
+ if ( !pile->IsOk() || pile->GetVal() != true )
{
return pj->Return(pile); // sends the results and releases the stack
}
@@ -140,7 +140,7 @@ void CBotWhile :: RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this); // adds an item to the stack
if ( pile == NULL ) return;
- switch( pile->GivState() )
+ switch( pile->GetState() )
{ // there are two possible states (depending on recovery)
case 0:
// evaluates the condition
@@ -181,7 +181,7 @@ CBotInstr* CBotRepeat::Compile(CBotToken* &p, CBotCStack* pStack)
if ( IsOfType( p, TokenTypVar ) &&
IsOfType( p, ID_DOTS ) )
{
- inst->m_label = pp->GivString(); // register the name of label
+ inst->m_label = pp->GetString(); // register the name of label
}
inst->SetToken(p);
@@ -194,7 +194,7 @@ CBotInstr* CBotRepeat::Compile(CBotToken* &p, CBotCStack* pStack)
CBotToken* ppp = p; // preserves the ^ token (starting position)
if ( NULL != (inst->m_NbIter = CBotExpression::Compile( p, pStk )) )
{
- if ( pStk->GivType() < CBotTypLong )
+ if ( pStk->GetType() < CBotTypLong )
{
if ( IsOfType(p, ID_CLOSEPAR ) )
{
@@ -210,14 +210,14 @@ CBotInstr* CBotRepeat::Compile(CBotToken* &p, CBotCStack* pStack)
return pStack->Return(inst, pStk); // return an object to the application
}
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
}
- pStk->SetStartError(ppp->GivStart());
- pStk->SetError( TX_BADTYPE, p->GivStart() );
+ pStk->SetStartError(ppp->GetStart());
+ pStk->SetError( TX_BADTYPE, p->GetStart() );
}
pStack->SetError(TX_ENDOF, p);
}
- pStack->SetError(TX_OPENPAR, p->GivStart()); // missing parenthesis
+ pStack->SetError(TX_OPENPAR, p->GetStart()); // missing parenthesis
delete inst; // error, frees up
return pStack->Return(NULL, pStk); // no object, the error is on the stack
@@ -233,7 +233,7 @@ bool CBotRepeat :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- while( true ) switch( pile->GivState() ) // executes the loop
+ while( true ) switch( pile->GetState() ) // executes the loop
{ // there are two possible states (depending on recovery)
case 0:
// evaluates the number of iterations
@@ -243,7 +243,7 @@ bool CBotRepeat :: Execute(CBotStack* &pj)
// terminates if an error or if the condition is false
int n;
- if ( !pile->IsOk() || ( n = pile->GivVal() ) < 1 )
+ if ( !pile->IsOk() || ( n = pile->GetVal() ) < 1 )
{
return pj->Return(pile); // sends the results and releases the stack
}
@@ -262,7 +262,7 @@ bool CBotRepeat :: Execute(CBotStack* &pj)
if ( m_Block != NULL &&
!m_Block->Execute(pile) )
{
- if (pile->IfContinue(pile->GivState()-1, m_label)) continue; // if continued, will return to test
+ if (pile->IfContinue(pile->GetState()-1, m_label)) continue; // if continued, will return to test
return pj->BreakReturn(pile, m_label); // sends the results and releases the stack
}
@@ -273,7 +273,7 @@ bool CBotRepeat :: Execute(CBotStack* &pj)
}
// returns to the test again
- if (!pile->SetState(pile->GivState()-1, 0)) return false;
+ if (!pile->SetState(pile->GetState()-1, 0)) return false;
continue;
}
}
@@ -284,7 +284,7 @@ void CBotRepeat :: RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this); // adds an item to the stack
if ( pile == NULL ) return;
- switch( pile->GivState() )
+ switch( pile->GetState() )
{ // there are two possible states (depending on recovery)
case 0:
// evaluates the condition
@@ -325,7 +325,7 @@ CBotInstr* CBotDo::Compile(CBotToken* &p, CBotCStack* pStack)
if ( IsOfType( p, TokenTypVar ) &&
IsOfType( p, ID_DOTS ) )
{
- inst->m_label = pp->GivString(); // register the name of label
+ inst->m_label = pp->GetString(); // register the name of label
}
inst->SetToken(p);
@@ -350,10 +350,10 @@ CBotInstr* CBotDo::Compile(CBotToken* &p, CBotCStack* pStack)
{
return pStack->Return(inst, pStk); // return an object to the application
}
- pStk->SetError(TX_ENDOF, p->GivStart());
+ pStk->SetError(TX_ENDOF, p->GetStart());
}
}
- pStk->SetError(TX_WHILE, p->GivStart());
+ pStk->SetError(TX_WHILE, p->GetStart());
}
delete inst; // error, frees up
@@ -370,7 +370,7 @@ bool CBotDo :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- while( true ) switch( pile->GivState() ) // executes the loop
+ while( true ) switch( pile->GetState() ) // executes the loop
{ // there are two possible states (depending on recovery)
case 0:
// evaluates the associated statement block
@@ -396,7 +396,7 @@ bool CBotDo :: Execute(CBotStack* &pj)
// the result of the condition is on the stack
// terminates if an error or if the condition is false
- if ( !pile->IsOk() || pile->GivVal() != true )
+ if ( !pile->IsOk() || pile->GetVal() != true )
{
return pj->Return(pile); // sends the results and releases the stack
}
@@ -414,7 +414,7 @@ void CBotDo :: RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this); // adds an item to the stack
if ( pile == NULL ) return;
- switch( pile->GivState() )
+ switch( pile->GetState() )
{ // there are two possible states (depending on recovery)
case 0:
// restores the assosiated statement's block
@@ -459,7 +459,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
if ( IsOfType( p, TokenTypVar ) &&
IsOfType( p, ID_DOTS ) )
{
- inst->m_label = pp->GivString(); // register the name of label
+ inst->m_label = pp->GetString(); // register the name of label
}
inst->SetToken(p);
@@ -467,7 +467,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
if ( !IsOfType(p, ID_OPENPAR)) // missing parenthesis ?
{
- pStack->SetError(TX_OPENPAR, p->GivStart());
+ pStack->SetError(TX_OPENPAR, p->GetStart());
return NULL;
}
@@ -479,7 +479,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
{
if ( !IsOfType(p, ID_SEP)) // lack the semicolon?
{
- pStack->SetError(TX_OPENPAR, p->GivStart());
+ pStack->SetError(TX_OPENPAR, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk); // no object, the error is on the stack
}
@@ -488,7 +488,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
{
if ( !IsOfType(p, ID_SEP)) // lack the semicolon?
{
- pStack->SetError(TX_OPENPAR, p->GivStart());
+ pStack->SetError(TX_OPENPAR, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk); // no object, the error is on the stack
}
@@ -503,7 +503,7 @@ CBotInstr* CBotFor::Compile(CBotToken* &p, CBotCStack* pStack)
if ( pStk->IsOk() )
return pStack->Return(inst, pStk);;
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
}
}
}
@@ -522,7 +522,7 @@ bool CBotFor :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- while( true ) switch( pile->GivState() ) // executes the loop
+ while( true ) switch( pile->GetState() ) // executes the loop
{ // there are four possible states (depending on recovery)
case 0:
// initialize
@@ -539,7 +539,7 @@ bool CBotFor :: Execute(CBotStack* &pj)
// the result of the condition is on the stack
// terminates if an error or if the condition is false
- if ( !pile->IsOk() || pile->GivVal() != true )
+ if ( !pile->IsOk() || pile->GetVal() != true )
{
return pj->Return(pile); // sends the results and releases the stack
}
@@ -583,7 +583,7 @@ void CBotFor :: RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this); // adds an item to the stack (variables locales)
if ( pile == NULL ) return;
- switch( pile->GivState() )
+ switch( pile->GetState() )
{ // there are four possible states (depending on recovery)
case 0:
// initialize
@@ -669,13 +669,13 @@ bool CBotListExpression::Execute(CBotStack* &pj)
CBotStack* pile = pj->AddStack(); // essential
CBotInstr* p = m_Expr; // the first expression
- int state = pile->GivState();
- while (state-->0) p = p->GivNext(); // returns to the interrupted operation
+ int state = pile->GetState();
+ while (state-->0) p = p->GetNext(); // returns to the interrupted operation
if ( p != NULL ) while (true)
{
if ( !p->Execute(pile) ) return false;
- p = p->GivNext();
+ p = p->GetNext();
if ( p == NULL ) break;
if (!pile->IncState()) return false; // ready for next
}
@@ -691,7 +691,7 @@ void CBotListExpression::RestoreState(CBotStack* &pj, bool bMain)
{
pile = pj->RestoreStack();
if ( pile == NULL ) return;
- state = pile->GivState();
+ state = pile->GetState();
}
CBotInstr* p = m_Expr; // the first expression
@@ -699,7 +699,7 @@ void CBotListExpression::RestoreState(CBotStack* &pj, bool bMain)
while (p != NULL && state-->0)
{
p->RestoreState(pile, false);
- p = p->GivNext(); // returns to the interrupted operation
+ p = p->GetNext(); // returns to the interrupted operation
}
if ( p != NULL )
@@ -741,7 +741,7 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
{
if ( NULL != (inst->m_Value = CBotExpression::Compile( p, pStk )) )
{
- if ( pStk->GivType() < CBotTypLong )
+ if ( pStk->GetType() < CBotTypLong )
{
if ( IsOfType(p, ID_CLOSEPAR ) )
{
@@ -751,7 +751,7 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
while( !IsOfType( p, ID_CLBLK ) )
{
- if ( p->GivType() == ID_CASE || p->GivType() == ID_DEFAULT)
+ if ( p->GetType() == ID_CASE || p->GetType() == ID_DEFAULT)
{
CBotCStack* pStk2 = pStk->TokenStack(p); // un petit bout de pile svp
@@ -769,7 +769,7 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
if ( inst->m_Block == NULL )
{
- pStk->SetError(TX_NOCASE, p->GivStart());
+ pStk->SetError(TX_NOCASE, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk);
}
@@ -793,21 +793,21 @@ CBotInstr* CBotSwitch::Compile(CBotToken* &p, CBotCStack* pStack)
if ( inst->m_Block == NULL )
{
- pStk->SetError(TX_NOCASE, p->GivStart());
+ pStk->SetError(TX_NOCASE, p->GetStart());
delete inst;
return pStack->Return(NULL, pStk);
}
// the statement block is ok
return pStack->Return(inst, pStk); // return an object to the application
}
- pStk->SetError( TX_OPENBLK, p->GivStart() );
+ pStk->SetError( TX_OPENBLK, p->GetStart() );
}
- pStk->SetError( TX_CLOSEPAR, p->GivStart() );
+ pStk->SetError( TX_CLOSEPAR, p->GetStart() );
}
- pStk->SetError( TX_BADTYPE, p->GivStart() );
+ pStk->SetError( TX_BADTYPE, p->GetStart() );
}
}
- pStk->SetError( TX_OPENPAR, p->GivStart());
+ pStk->SetError( TX_OPENPAR, p->GetStart());
delete inst; // error, frees up
return pStack->Return(NULL, pStk); // no object, the error is on the stack
@@ -822,7 +822,7 @@ bool CBotSwitch :: Execute(CBotStack* &pj)
CBotInstr* p = m_Block; // first expression
- int state = pile1->GivState();
+ int state = pile1->GetState();
if (state == 0)
{
if ( !m_Value->Execute(pile1) ) return false;
@@ -834,14 +834,14 @@ bool CBotSwitch :: Execute(CBotStack* &pj)
if ( state == -1 )
{
state = 0;
- int val = pile1->GivVal(); // result of the value
+ int val = pile1->GetVal(); // result of the value
CBotStack* pile2 = pile1->AddStack();
while ( p != NULL ) // search for the corresponding case in a list
{
state++;
if ( p->CompCase( pile2, val ) ) break; // found the case
- p = p->GivNext();
+ p = p->GetNext();
}
pile2->Delete();
@@ -851,13 +851,13 @@ bool CBotSwitch :: Execute(CBotStack* &pj)
}
p = m_Block; // returns to the beginning
- while (state-->0) p = p->GivNext(); // advance in the list
+ while (state-->0) p = p->GetNext(); // advance in the list
while( p != NULL )
{
if ( !p->Execute(pile1) ) return pj->BreakReturn(pile1);
if ( !pile1->IncState() ) return false;
- p = p->GivNext();
+ p = p->GetNext();
}
return pj->Return(pile1);
}
@@ -871,7 +871,7 @@ void CBotSwitch :: RestoreState(CBotStack* &pj, bool bMain)
CBotInstr* p = m_Block; // first expression
- int state = pile1->GivState();
+ int state = pile1->GetState();
if (state == 0)
{
m_Value->RestoreState(pile1, bMain);
@@ -887,7 +887,7 @@ void CBotSwitch :: RestoreState(CBotStack* &pj, bool bMain)
while ( p != NULL && state-- > 0 )
{
p->RestoreState(pile1, false);
- p = p->GivNext(); // advance in the list
+ p = p->GetNext(); // advance in the list
}
if( p != NULL )
@@ -923,7 +923,7 @@ CBotInstr* CBotCase::Compile(CBotToken* &p, CBotCStack* pStack)
inst->SetToken(p);
if (!IsOfType(p, ID_CASE, ID_DEFAULT)) return NULL; // should never happen
- if ( pp->GivType() == ID_CASE )
+ if ( pp->GetType() == ID_CASE )
{
pp = p;
inst->m_Value = CBotExprNum::Compile(p, pStack);
@@ -936,7 +936,7 @@ CBotInstr* CBotCase::Compile(CBotToken* &p, CBotCStack* pStack)
}
if ( !IsOfType( p, ID_DOTS ))
{
- pStack->SetError( TX_MISDOTS, p->GivStart() );
+ pStack->SetError( TX_MISDOTS, p->GetStart() );
delete inst;
return NULL;
}
@@ -963,7 +963,7 @@ bool CBotCase::CompCase(CBotStack* &pile, int val)
if ( m_Value == NULL ) return true; // "default" case
while (!m_Value->Execute(pile)); // puts the value on the correspondent stack (without interruption)
- return (pile->GivVal() == val); // compared with the given value
+ return (pile->GetVal() == val); // compared with the given value
}
///////////////////////////////////////////////////////////////////////////
@@ -983,7 +983,7 @@ CBotBreak::~CBotBreak()
CBotInstr* CBotBreak::Compile(CBotToken* &p, CBotCStack* pStack)
{
CBotToken* pp = p; // preserves at the ^ token (starting position)
- int type = p->GivType();
+ int type = p->GetType();
if (!IsOfType(p, ID_BREAK, ID_CONTINUE)) return NULL; // should never happen
@@ -999,7 +999,7 @@ CBotInstr* CBotBreak::Compile(CBotToken* &p, CBotCStack* pStack)
pp = p;
if ( IsOfType( p, TokenTypVar ) )
{
- inst->m_label = pp->GivString(); // register the name of label
+ inst->m_label = pp->GetString(); // register the name of label
if ( !ChkLvl(inst->m_label, type ) )
{
delete inst;
@@ -1014,7 +1014,7 @@ CBotInstr* CBotBreak::Compile(CBotToken* &p, CBotCStack* pStack)
}
delete inst;
- pStack->SetError(TX_ENDOF, p->GivStart());
+ pStack->SetError(TX_ENDOF, p->GetStart());
return NULL; // no object, the error is on the stack
}
@@ -1027,7 +1027,7 @@ bool CBotBreak :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- pile->SetBreak(m_token.GivType()==ID_BREAK ? 1 : 2, m_label);
+ pile->SetBreak(m_token.GetType()==ID_BREAK ? 1 : 2, m_label);
return pj->Return(pile);
}
@@ -1070,7 +1070,7 @@ CBotInstr* CBotTry::Compile(CBotToken* &p, CBotCStack* pStack)
inst->m_Block = CBotBlock::CompileBlkOrInst( p, pStk );
CBotCatch** pn = &inst->m_ListCatch;
- while (pStk->IsOk() && p->GivType() == ID_CATCH)
+ while (pStk->IsOk() && p->GetType() == ID_CATCH)
{
CBotCatch* i = CBotCatch::Compile(p, pStk);
*pn = i;
@@ -1108,7 +1108,7 @@ bool CBotTry :: Execute(CBotStack* &pj)
CBotStack* pile0 = pj->AddStack2(); // adds an element to the secondary stack
CBotStack* pile2 = pile0->AddStack();
- if ( pile1->GivState() == 0 )
+ if ( pile1->GetState() == 0 )
{
if ( m_Block->Execute(pile1) )
{
@@ -1116,7 +1116,7 @@ bool CBotTry :: Execute(CBotStack* &pj)
pile1->SetState(-2); // passes final
}
- val = pile1->GivError();
+ val = pile1->GetError();
if ( val == 0 && CBotStack::m_initimer == 0 ) // mode step?
return false; // does not make the catch
@@ -1132,8 +1132,8 @@ bool CBotTry :: Execute(CBotStack* &pj)
// see what it returns
CBotCatch* pc = m_ListCatch;
- int state = (short)pile1->GivState(); // where were we?
- val = pile2->GivState(); // what error?
+ int state = (short)pile1->GetState(); // where were we?
+ val = pile2->GetState(); // what error?
pile0->SetState(1); // marking the GetRunPos
if ( val >= 0 && state > 0 ) while ( pc != NULL )
@@ -1147,7 +1147,7 @@ bool CBotTry :: Execute(CBotStack* &pj)
}
if ( --state <= 0 )
{
- if ( pile2->GivVal() == true )
+ if ( pile2->GetVal() == true )
{
// pile0->SetState(1);
@@ -1163,15 +1163,15 @@ bool CBotTry :: Execute(CBotStack* &pj)
pc = pc->m_next;
}
if ( m_FinalInst != NULL &&
- pile1->GivState() > 0 && val != 0 ) pile1->SetState(-1);// if stop then made the final
+ pile1->GetState() > 0 && val != 0 ) pile1->SetState(-1);// if stop then made the final
- if (pile1->GivState() <= -1)
+ if (pile1->GetState() <= -1)
{
// pile0->SetState(1);
if (!m_FinalInst->Execute(pile2) && pile2->IsOk()) return false;
if (!pile2->IsOk()) return pj->Return(pile2); // keep this exception
- pile2->SetError(pile1->GivState()==-1 ? val : 0); // gives the initial error
+ pile2->SetError(pile1->GetState()==-1 ? val : 0); // gives the initial error
return pj->Return(pile2);
}
@@ -1200,7 +1200,7 @@ void CBotTry :: RestoreState(CBotStack* &pj, bool bMain)
if ( pile2 == NULL ) return;
m_Block->RestoreState(pile1, bMain);
- if ( pile0->GivState() == 0 )
+ if ( pile0->GetState() == 0 )
{
return;
}
@@ -1209,8 +1209,8 @@ void CBotTry :: RestoreState(CBotStack* &pj, bool bMain)
// see what it returns
CBotCatch* pc = m_ListCatch;
- int state = pile1->GivState(); // where were we ?
- val = pile2->GivState(); // what error ?
+ int state = pile1->GetState(); // where were we ?
+ val = pile2->GetState(); // what error ?
if ( val >= 0 && state > 0 ) while ( pc != NULL )
{
@@ -1223,7 +1223,7 @@ void CBotTry :: RestoreState(CBotStack* &pj, bool bMain)
}
if ( --state <= 0 )
{
- if ( pile2->GivVal() == true )
+ if ( pile2->GetVal() == true )
{
pc->RestoreState(pile2, bMain); // execute the operation
return;
@@ -1232,7 +1232,7 @@ void CBotTry :: RestoreState(CBotStack* &pj, bool bMain)
pc = pc->m_next;
}
- if (pile1->GivState() <= -1)
+ if (pile1->GetState() <= -1)
{
m_FinalInst->RestoreState(pile2, bMain);
return;
@@ -1263,7 +1263,7 @@ CBotCatch::~CBotCatch()
CBotCatch* CBotCatch::Compile(CBotToken* &p, CBotCStack* pStack)
{
CBotCatch* inst = new CBotCatch(); // creates the object
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
inst->SetToken(p);
if (!IsOfType(p, ID_CATCH)) return NULL; // should never happen
@@ -1271,8 +1271,8 @@ CBotCatch* CBotCatch::Compile(CBotToken* &p, CBotCStack* pStack)
if (IsOfType(p, ID_OPENPAR))
{
inst->m_Cond = CBotExpression::Compile(p, pStack);
- if (( pStack->GivType() < CBotTypLong ||
- pStack->GivTypResult().Eq(CBotTypBoolean) )&& pStack->IsOk() )
+ if (( pStack->GetType() < CBotTypLong ||
+ pStack->GetTypResult().Eq(CBotTypBoolean) )&& pStack->IsOk() )
{
if (IsOfType(p, ID_CLOSEPAR))
{
@@ -1280,11 +1280,11 @@ CBotCatch* CBotCatch::Compile(CBotToken* &p, CBotCStack* pStack)
if ( pStack->IsOk() )
return inst; // return an object to the application
}
- pStack->SetError(TX_CLOSEPAR, p->GivStart());
+ pStack->SetError(TX_CLOSEPAR, p->GetStart());
}
- pStack->SetError(TX_BADTYPE, p->GivStart());
+ pStack->SetError(TX_BADTYPE, p->GetStart());
}
- pStack->SetError(TX_OPENPAR, p->GivStart());
+ pStack->SetError(TX_OPENPAR, p->GetStart());
delete inst; // error, frees up
return NULL; // no object, the error is on the stack
}
@@ -1313,10 +1313,10 @@ bool CBotCatch :: TestCatch(CBotStack* &pile, int val)
{
if ( !m_Cond->Execute(pile) ) return false;
- if ( val > 0 || pile->GivType() != CBotTypBoolean )
+ if ( val > 0 || pile->GetType() != CBotTypBoolean )
{
CBotVar* var = CBotVar::Create((CBotToken*)NULL, CBotTypBoolean);
- var->SetValInt( pile->GivVal() == val );
+ var->SetValInt( pile->GetVal() == val );
pile->SetVar(var); // calls on the stack
}
@@ -1342,7 +1342,7 @@ CBotThrow::~CBotThrow()
CBotInstr* CBotThrow::Compile(CBotToken* &p, CBotCStack* pStack)
{
- pStack->SetStartError(p->GivStart());
+ pStack->SetStartError(p->GetStart());
CBotThrow* inst = new CBotThrow(); // creates the object
inst->SetToken(p);
@@ -1353,7 +1353,7 @@ CBotInstr* CBotThrow::Compile(CBotToken* &p, CBotCStack* pStack)
inst->m_Value = CBotExpression::Compile( p, pStack );
- if (pStack->GivType() < CBotTypLong && pStack->IsOk())
+ if (pStack->GetType() < CBotTypLong && pStack->IsOk())
{
return inst; // return an object to the application
}
@@ -1370,7 +1370,7 @@ bool CBotThrow :: Execute(CBotStack* &pj)
CBotStack* pile = pj->AddStack(this);
// if ( pile == EOX ) return true;
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
if ( !m_Value->Execute(pile) ) return false;
pile->IncState();
@@ -1378,7 +1378,7 @@ bool CBotThrow :: Execute(CBotStack* &pj)
if ( pile->IfStep() ) return false;
- int val = pile->GivVal();
+ int val = pile->GetVal();
if ( val < 0 ) val = TX_BADTHROW;
pile->SetError( val, &m_token );
return pj->Return( pile );
@@ -1391,7 +1391,7 @@ void CBotThrow :: RestoreState(CBotStack* &pj, bool bMain)
CBotStack* pile = pj->RestoreStack(this);
if ( pile == NULL ) return;
- if ( pile->GivState() == 0 )
+ if ( pile->GetState() == 0 )
{
m_Value->RestoreState(pile, bMain);
return;
@@ -1425,7 +1425,7 @@ CBotInstr* CBotStartDebugDD::Compile(CBotToken* &p, CBotCStack* pStack)
bool CBotStartDebugDD :: Execute(CBotStack* &pj)
{
- CBotProgram* p = pj->GivBotCall();
+ CBotProgram* p = pj->GetBotCall();
p->m_bDebugDD = true;
return true;
diff --git a/src/CBot/ClassFILE.cpp b/src/CBot/ClassFILE.cpp
index f73a1ac..e5bc260 100644
--- a/src/CBot/ClassFILE.cpp
+++ b/src/CBot/ClassFILE.cpp
@@ -68,25 +68,25 @@ bool rfconstruct (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exceptio
if ( pVar == NULL ) return true;
// must be a string
- if ( pVar->GivType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
+ if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
- CBotString filename = pVar->GivValString();
+ CBotString filename = pVar->GetValString();
PrepareFilename(filename); //DR
// there may be a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar != NULL )
{
// recovers the mode
- mode = pVar->GivValString();
+ mode = pVar->GetValString();
if ( mode != "r" && mode != "w" ) { Exception = CBotErrBadParam; return false; }
// no third parameter, only two or one possible
- if ( pVar->GivNext() != NULL ) { Exception = CBotErrOverParam; return false; }
+ if ( pVar->GetNext() != NULL ) { Exception = CBotErrOverParam; return false; }
}
// save the file name
- pVar = pThis->GivItem("filename");
+ pVar = pThis->GetItem("filename");
pVar->SetValString(filename);
if ( ! mode.IsEmpty() )
@@ -98,7 +98,7 @@ bool rfconstruct (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exceptio
m_CompteurFileOpen ++;
// save the handle of file
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
pVar->SetValInt((long)pFile);
}
@@ -112,18 +112,18 @@ CBotTypResult cfconstruct (CBotVar* pThis, CBotVar* &pVar)
if ( pVar == NULL ) return CBotTypResult( 0 );
// must be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( CBotErrBadString );
// there may be a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar != NULL )
{
// must be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( CBotErrBadString );
// no third parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( CBotErrOverParam );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
}
// le r�sultat est de type void (constructeur)
@@ -137,12 +137,12 @@ CBotTypResult cfconstruct (CBotVar* pThis, CBotVar* &pVar)
bool rfdestruct (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
{
// retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
// not open? no problem
- if ( pVar->GivInit() != IS_DEF) return true;
+ if ( pVar->GetInit() != IS_DEF) return true;
- FILE* pFile= (FILE*)pVar->GivValInt();
+ FILE* pFile= (FILE*)pVar->GetValInt();
fclose(pFile);
m_CompteurFileOpen --;
@@ -162,38 +162,38 @@ bool rfopen (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
if ( pVar == NULL ) { Exception = CBotErrLowParam; return false; }
// must be a string
- if ( pVar->GivType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
+ if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
// there may be a second parameter
- if ( pVar->GivNext() != NULL )
+ if ( pVar->GetNext() != NULL )
{
// in this case the first parameter is the file name
- CBotString filename = pVar->GivValString();
+ CBotString filename = pVar->GetValString();
PrepareFilename(filename); //DR
// saves the file name
- CBotVar* pVar2 = pThis->GivItem("filename");
+ CBotVar* pVar2 = pThis->GetItem("filename");
pVar2->SetValString(filename);
// next parameter is the mode
- pVar = pVar -> GivNext();
+ pVar = pVar -> GetNext();
}
- CBotString mode = pVar->GivValString();
+ CBotString mode = pVar->GetValString();
if ( mode != "r" && mode != "w" ) { Exception = CBotErrBadParam; return false; }
// No third parameter
- if ( pVar->GivNext() != NULL ) { Exception = CBotErrOverParam; return false; }
+ if ( pVar->GetNext() != NULL ) { Exception = CBotErrOverParam; return false; }
// retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
// which must not be initialized
- if ( pVar->GivInit() == IS_DEF) { Exception = CBotErrFileOpen; return false; }
+ if ( pVar->GetInit() == IS_DEF) { Exception = CBotErrFileOpen; return false; }
// contains filename
- pVar = pThis->GivItem("filename");
- CBotString filename = pVar->GivValString();
+ pVar = pThis->GetItem("filename");
+ CBotString filename = pVar->GetValString();
PrepareFilename(filename); //DD! (if the name was assigned by h.filename = "...";
@@ -208,7 +208,7 @@ bool rfopen (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
m_CompteurFileOpen ++;
// saves the handle of file
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
pVar->SetValInt((long)pFile);
pResult->SetValInt(true); //DR
@@ -222,19 +222,19 @@ CBotTypResult cfopen (CBotVar* pThis, CBotVar* &pVar)
if ( pVar == NULL ) return CBotTypResult( CBotErrLowParam );
// must be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( CBotErrBadString );
// there may be a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar != NULL )
{
// must be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( CBotErrBadString );
// no third parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( CBotErrOverParam );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
}
// the result is of type bool
@@ -251,11 +251,11 @@ bool rfclose (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
if ( pVar != NULL ) return CBotErrOverParam;
// retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
- if ( pVar->GivInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
+ if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
- FILE* pFile= (FILE*)pVar->GivValInt();
+ FILE* pFile= (FILE*)pVar->GetValInt();
fclose(pFile);
m_CompteurFileOpen --;
@@ -283,16 +283,16 @@ bool rfwrite (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
if ( pVar == NULL ) { Exception = CBotErrLowParam; return false; }
// must be a string
- if ( pVar->GivType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
+ if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
- CBotString param = pVar->GivValString();
+ CBotString param = pVar->GetValString();
//retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
- if ( pVar->GivInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
+ if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
- FILE* pFile= (FILE*)pVar->GivValInt();
+ FILE* pFile= (FILE*)pVar->GetValInt();
int res = fputs(param+CBotString("\n"), pFile);
@@ -309,10 +309,10 @@ CBotTypResult cfwrite (CBotVar* pThis, CBotVar* &pVar)
if ( pVar == NULL ) return CBotTypResult( CBotErrLowParam );
// must be a string
- if ( pVar->GivType() != CBotTypString ) return CBotTypResult( CBotErrBadString );
+ if ( pVar->GetType() != CBotTypString ) return CBotTypResult( CBotErrBadString );
// no other parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( CBotErrOverParam );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
// function returns "void" result
return CBotTypResult( 0 );
@@ -327,11 +327,11 @@ bool rfread (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
if ( pVar != NULL ) { Exception = CBotErrOverParam; return false; }
//retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
- if ( pVar->GivInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
+ if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
- FILE* pFile= (FILE*)pVar->GivValInt();
+ FILE* pFile= (FILE*)pVar->GetValInt();
char chaine[2000];
int i;
@@ -368,11 +368,11 @@ bool rfeof (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
if ( pVar != NULL ) { Exception = CBotErrOverParam; return false; }
// retrieves the element "handle"
- pVar = pThis->GivItem("handle");
+ pVar = pThis->GetItem("handle");
- if ( pVar->GivInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
+ if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
- FILE* pFile= (FILE*)pVar->GivValInt();
+ FILE* pFile= (FILE*)pVar->GetValInt();
pResult->SetValInt( feof( pFile ) );
diff --git a/src/CBot/StringFunctions.cpp b/src/CBot/StringFunctions.cpp
index 39bafca..d24c942 100644
--- a/src/CBot/StringFunctions.cpp
+++ b/src/CBot/StringFunctions.cpp
@@ -26,16 +26,16 @@ bool rStrLen( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// no second parameter
- if ( pVar->GivNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// puts the length of the stack
- pResult->SetValInt( s.GivLength() );
+ pResult->SetValInt( s.GetLength() );
return true;
}
@@ -48,11 +48,11 @@ CBotTypResult cIntStr( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADPARAM );
// no second parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
// the end result is an integer
return CBotTypResult( CBotTypInt );
@@ -68,23 +68,23 @@ bool rStrLeft( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// which must be a number
- if ( pVar->GivType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
+ if ( pVar->GetType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
// retrieves this number
- int n = pVar->GivValInt();
+ int n = pVar->GetValInt();
// no third parameter
- if ( pVar->GivNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
// takes the interesting part
s = s.Left( n );
@@ -103,19 +103,19 @@ CBotTypResult cStrStrInt( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// which must be a number
- if ( pVar->GivType() > CBotTypDouble )
+ if ( pVar->GetType() > CBotTypDouble )
return CBotTypResult( TX_BADNUM );
// no third parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
// the end result is a string
return CBotTypResult( CBotTypString );
@@ -130,23 +130,23 @@ bool rStrRight( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// which must be a number
- if ( pVar->GivType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
+ if ( pVar->GetType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
// retrieves this number
- int n = pVar->GivValInt();
+ int n = pVar->GetValInt();
// no third parameter
- if ( pVar->GivNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
// takes the interesting part
s = s.Right( n );
@@ -165,34 +165,34 @@ bool rStrMid( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// which must be a number
- if ( pVar->GivType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
+ if ( pVar->GetType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
// retrieves this number
- int n = pVar->GivValInt();
+ int n = pVar->GetValInt();
// third parameter optional
- if ( pVar->GivNext() != NULL )
+ if ( pVar->GetNext() != NULL )
{
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
// which must be a number
- if ( pVar->GivType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
+ if ( pVar->GetType() > CBotTypDouble ) { ex = TX_BADNUM ; return true; }
// retrieves this number
- int l = pVar->GivValInt();
+ int l = pVar->GetValInt();
// but no fourth parameter
- if ( pVar->GivNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
// takes the interesting part
s = s.Mid( n, l );
@@ -217,28 +217,28 @@ CBotTypResult cStrStrIntInt( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// which must be a number
- if ( pVar->GivType() > CBotTypDouble )
+ if ( pVar->GetType() > CBotTypDouble )
return CBotTypResult( TX_BADNUM );
// third parameter optional
- if ( pVar->GivNext() != NULL )
+ if ( pVar->GetNext() != NULL )
{
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
// which must be a number
- if ( pVar->GivType() > CBotTypDouble )
+ if ( pVar->GetType() > CBotTypDouble )
return CBotTypResult( TX_BADNUM );
// no fourth parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
}
// the end result is a string
@@ -255,15 +255,15 @@ bool rStrVal( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// but no second parameter
- if ( pVar->GivNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
- float val = GivNumFloat(s);
+ float val = GetNumFloat(s);
// puts the value on the stack
pResult->SetValFloat( val );
@@ -279,11 +279,11 @@ CBotTypResult cFloatStr( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// no second parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
// the end result is a number
return CBotTypResult( CBotTypFloat );
@@ -299,23 +299,23 @@ bool rStrFind( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// retrieves this number
- CBotString s2 = pVar->GivValString();
+ CBotString s2 = pVar->GetValString();
// no third parameter
- if ( pVar->GivNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ) { ex = TX_OVERPARAM ; return true; }
// puts the result on the stack
int res = s.Find(s2);
@@ -333,19 +333,19 @@ CBotTypResult cIntStrStr( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// it takes a second parameter
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// no third parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
// the end result is a number
return CBotTypResult( CBotTypInt );
@@ -360,13 +360,13 @@ bool rStrUpper( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// but no second parameter
- if ( pVar->GivNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
s.MakeUpper();
@@ -385,13 +385,13 @@ bool rStrLower( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
if ( pVar == NULL ) { ex = TX_LOWPARAM ; return true; }
// to be a string
- if ( pVar->GivType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
+ if ( pVar->GetType() != CBotTypString ) { ex = TX_BADSTRING ; return true; }
// get the contents of the string
- CBotString s = pVar->GivValString();
+ CBotString s = pVar->GetValString();
// but no second parameter
- if ( pVar->GivNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
+ if ( pVar->GetNext() != NULL ){ ex = TX_OVERPARAM ; return true; }
s.MakeLower();
@@ -410,11 +410,11 @@ CBotTypResult cStrStr( CBotVar* &pVar, void* pUser )
if ( pVar == NULL ) return CBotTypResult( TX_LOWPARAM );
// to be a string
- if ( pVar->GivType() != CBotTypString )
+ if ( pVar->GetType() != CBotTypString )
return CBotTypResult( TX_BADSTRING );
// no second parameter
- if ( pVar->GivNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
+ if ( pVar->GetNext() != NULL ) return CBotTypResult( TX_OVERPARAM );
// the end result is a string
return CBotTypResult( CBotTypString );
diff --git a/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp b/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp
index a4a90ae..e9209d3 100644
--- a/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp
+++ b/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp
@@ -50,7 +50,7 @@ uint ThreadProc(ThreadInfo *info)
int level = 0;
do
{
- CBotVar* t = info->m_pProg->GivStackVars(FN, level--);
+ CBotVar* t = info->m_pProg->GetStackVars(FN, level--);
if ( FN != FunctionName ) break;
if ( t != NULL )
{
@@ -59,8 +59,8 @@ uint ThreadProc(ThreadInfo *info)
{
if (s.IsEmpty()) s+= "Stack -> ";
else s+= " , ";
- s += t->GivValString();
- t = t->GivNext();
+ s += t->GetValString();
+ t = t->GetNext();
}
AfxMessageBox(s);
}
@@ -75,7 +75,7 @@ uint ThreadProc(ThreadInfo *info)
{
std::cout << "\nInterrupt\n";
}
- else if (info->m_pProg->GivError() == 0)
+ else if (info->m_pProg->GetError() == 0)
{
time(&t1);
double prog_time = difftime(t0,t1);
@@ -98,7 +98,7 @@ long CBotConsole::EndProg()
if (m_pProg->GetError(m_code, m_start, m_end))
{
CBotString TextError;
- TextError = CBotProgram::GivErrorText(m_code);
+ TextError = CBotProgram::GetErrorText(m_code);
std::cout << TextError;
return 1;
}
@@ -125,7 +125,7 @@ void CBotConsole::OnOK()
if ( m_pProg->GetError(err, start, end) )
{
CBotString TextError;
- TextError = CBotProgram::GivErrorText(err);
+ TextError = CBotProgram::GetErrorText(err);
std::cout << TextError;
return;
}
@@ -162,7 +162,7 @@ bool CBotConsole::OnInitDialog()
// CDialog::OnInitDialog();
std::cout << "Following functions are availible:\n";
- for ( int i = 0; i < m_pListe->GivSize(); i++ )
+ for ( int i = 0; i < m_pListe->GetSize(); i++ )
{
CBotString x = (*m_pListe)[i] + CBotString("\n");
std::cout << x;
diff --git a/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp b/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp
index ad90da2..1c694c9 100644
--- a/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp
+++ b/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp
@@ -46,18 +46,18 @@ void CBotDoc::OnRun()
delete m_pProg;
m_pProg = NULL;
- TextError = CBotProgram::GivErrorText( code );
+ TextError = CBotProgram::GetErrorText( code );
std::cout << TextError << std::endl;
return;
}
- if( m_Liste.GivSize() == 0 )
+ if( m_Liste.GetSize() == 0 )
{
std::cout << "No function marked \"extern\" !\n";
return;
}
- for ( int i = 0; i < m_Liste.GivSize(); i++ )
+ for ( int i = 0; i < m_Liste.GetSize(); i++ )
{
int start, stop;
m_pProg->GetPosition(m_Liste[i], start, stop, GetPosNom, GetPosParam);
@@ -76,7 +76,7 @@ void CBotDoc::OnRun()
// {
// std::string TextError;
//
-// TextError = m_pProg->GivErrorText( dlg.m_code );
+// TextError = m_pProg->GetErrorText( dlg.m_code );
//
// std::cout <<TextError;
// }
@@ -105,7 +105,7 @@ bool CBotDoc::Compile()
// m_pEdit->SetSel( start, end );
// m_pEdit->SetFocus(); // higlights part of problem
- TextError = CBotProgram::GivErrorText( code );
+ TextError = CBotProgram::GetErrorText( code );
std::cout << TextError ;
return false;
diff --git a/src/CBot/tests/CBot_console/src/app/CClass.cpp b/src/CBot/tests/CBot_console/src/app/CClass.cpp
index 414c1e4..9b7c842 100644
--- a/src/CBot/tests/CBot_console/src/app/CClass.cpp
+++ b/src/CBot/tests/CBot_console/src/app/CClass.cpp
@@ -6,20 +6,20 @@ void rMajObject( CBotVar* pThis, void* pUser )
{
if (!pThis->IsElemOfClass("object"))
return ;
- CBotVar* pPos = pThis->GivItem("position");
- CBotVar* pX = pPos->GivItem("x");
- CBotVar* pY = pPos->GivItem("y");
- CBotVar* pZ = pPos->GivItem("z");
-// CBotVar* pPt = pThis->GivItem("transport");
+ CBotVar* pPos = pThis->GetItem("position");
+ CBotVar* pX = pPos->GetItem("x");
+ CBotVar* pY = pPos->GetItem("y");
+ CBotVar* pZ = pPos->GetItem("z");
+// CBotVar* pPt = pThis->GetItem("transport");
- CBotString p = pX->GivValString();
+ CBotString p = pX->GetValString();
// pX->SetValFloat( pUser == (void*)1 ? (float)12.5 : (float)44.4 );
pZ->SetValFloat( (float)0 );
pY->SetValFloat( (float)-3.33 );
- pX->SetValFloat( pX->GivValFloat() + 10 ) ;
+ pX->SetValFloat( pX->GetValFloat() + 10 ) ;
-// pX = pThis->GivItem( "xx" );
+// pX = pThis->GetItem( "xx" );
// pX->SetValFloat( (float)22 );
// crée une instance sur une classe object
diff --git a/src/CBot/tests/CBot_console/src/app/routines.cpp b/src/CBot/tests/CBot_console/src/app/routines.cpp
index 54355c7..8b8a1d4 100644
--- a/src/CBot/tests/CBot_console/src/app/routines.cpp
+++ b/src/CBot/tests/CBot_console/src/app/routines.cpp
@@ -33,16 +33,16 @@ bool rShow( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
{
string::string ss;
- ss.LoadString( TX_TYPENAMES + pVar->GivType() );
+ ss.LoadString( TX_TYPENAMES + pVar->GetType() );
s += ss + " ";
- ss = pVar->GivName();
+ ss = pVar->GetName();
if (ss.IsEmpty()) ss = "<sans nom>";
s += ss + " = ";
- s += pVar->GivValString();
+ s += pVar->GetValString();
s += "\n";
- pVar = pVar->GivNext();
+ pVar = pVar->GetNext();
}
AfxMessageBox(s, MB_OK|MB_ICONINFORMATION);
@@ -70,8 +70,8 @@ bool rPrintLn( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
while ( pVar != NULL )
{
if ( !s.empty() ) s += " ";
- s += pVar->GivValString();
- pVar = pVar->GivNext();
+ s += pVar->GetValString();
+ pVar = pVar->GetNext();
}
s += "\n";
@@ -85,8 +85,8 @@ bool rPrint( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
while ( pVar != NULL )
{
if ( !s.empty() ) s += " ";
- s += pVar->GivValString();
- pVar = pVar->GivNext();
+ s += pVar->GetValString();
+ pVar = pVar->GetNext();
}
s += " ";
std::cout << s;
@@ -107,13 +107,13 @@ bool rCPoint( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
{
if ( pVar == NULL )return true; // constructor with no parameters is ok
- CBotVar* pX = pThis->GivItem("x");
- pX->SetValFloat( pVar->GivValFloat() );
- pVar = pVar->GivNext();
+ CBotVar* pX = pThis->GetItem("x");
+ pX->SetValFloat( pVar->GetValFloat() );
+ pVar = pVar->GetNext();
- CBotVar* pY = pThis->GivItem("y");
- pY->SetValFloat( pVar->GivValFloat() );
- pVar = pVar->GivNext();
+ CBotVar* pY = pThis->GetItem("y");
+ pY->SetValFloat( pVar->GetValFloat() );
+ pVar = pVar->GetNext();
return true; // pas d'interruption
}
@@ -124,14 +124,14 @@ CBotTypResult cCPoint( CBotVar* pThis, CBotVar* &pVar)
if ( pVar == NULL ) return CBotTypResult(0);
// numeric type of parameter please
- if ( pVar->GivType() > CBotTypDouble ) return CBotTypResult(5011);
- pVar = pVar->GivNext();
+ if ( pVar->GetType() > CBotTypDouble ) return CBotTypResult(5011);
+ pVar = pVar->GetNext();
// there must be a second parameter
if ( pVar == NULL ) return 5028;
// also numeric
- if ( pVar->GivType() > CBotTypDouble )return CBotTypResult(5011);
- pVar = pVar->GivNext();
+ if ( pVar->GetType() > CBotTypDouble )return CBotTypResult(5011);
+ pVar = pVar->GetNext();
// and not more than 2 parameters please
if ( pVar != NULL ) return CBotTypResult(5026);