summaryrefslogtreecommitdiffstats
path: root/src/CBot/old TstCBot/TstCBot.cpp
diff options
context:
space:
mode:
authorKrzysztof H <krzys_h@interia.pl>2012-03-19 12:44:39 +0100
committerKrzysztof H <krzys_h@interia.pl>2012-03-19 12:44:39 +0100
commitf7d892cf4ef6bfce3747c4b6a810d4828b79833d (patch)
tree8311c7057b5f861c387ecc8c96cd778abc47c8d8 /src/CBot/old TstCBot/TstCBot.cpp
parent343cb0ce660136ac034e6106c0f151466b751398 (diff)
downloadcolobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.tar.gz
colobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.tar.bz2
colobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.zip
Last coding fix ;)
Diffstat (limited to 'src/CBot/old TstCBot/TstCBot.cpp')
-rw-r--r--src/CBot/old TstCBot/TstCBot.cpp71
1 files changed, 29 insertions, 42 deletions
diff --git a/src/CBot/old TstCBot/TstCBot.cpp b/src/CBot/old TstCBot/TstCBot.cpp
index 2cc2c9b..8ac4557 100644
--- a/src/CBot/old TstCBot/TstCBot.cpp
+++ b/src/CBot/old TstCBot/TstCBot.cpp
@@ -1,18 +1,5 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+// TstCBot.cpp : Defines the class behaviors for the application.
+//
#include "stdafx.h"
#include "TstCBot.h"
@@ -32,9 +19,9 @@ static char THIS_FILE[] = __FILE__;
////////////////////////////////////////////////////////////////////
// routine show()
-// utilisable depuis le programme �crit en CBot
+// utilisable depuis le programme écrit en CBot
-// ex�cution
+// exécution
BOOL rShow( CBotVar* pVar, CBotVar* pResult, int& Exception )
{
CString s;
@@ -69,7 +56,7 @@ BOOL rShow( CBotVar* pVar, CBotVar* pResult, int& Exception )
int cShow( CBotVar* &pVar, CBotString& RetClass)
{
if ( pVar == NULL ) return 22;
- return CBotTypInt; // tous param�tres accept�s, un entier en retour
+ return CBotTypInt; // tous paramètres acceptés, un entier en retour
}
int cErr( CBotVar* &pVar, CBotString& RetClass)
@@ -80,9 +67,9 @@ int cErr( CBotVar* &pVar, CBotString& RetClass)
////////////////////////////////////////////////////////////////////
// routine print()
-// utilisable depuis le programme �crit en CBot
+// utilisable depuis le programme écrit en CBot
-// ex�cution
+// exécution
BOOL rPrintLn( CBotVar* pVar, CBotVar* pResult, int& Exception )
{
CString s;
@@ -131,19 +118,19 @@ BOOL rPrint( CBotVar* pVar, CBotVar* pResult, int& Exception )
int cPrint( CBotVar* &pVar, CBotString& RetClass)
{
- return 0; // tous param�tres accept�s, un entier en retour
+ return 0; // tous paramètres acceptés, un entier en retour
}
//////////////////////////////////////////////////////////////////
// class CPoint pour essayer
-// ex�cution
+// exécution
BOOL rCPoint( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
{
CString s;
- if ( pVar == NULL )return TRUE; // constructeur sans param�tres est ok
+ if ( pVar == NULL )return TRUE; // constructeur sans paramètres est ok
if ( pVar->RetType() > CBotTypDouble )
{
@@ -188,41 +175,41 @@ BOOL rCPoint( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
int cCPoint( CBotVar* pThis, CBotVar* &pVar, CBotString& RetClass)
{
- // l'objet doit �tre de la classe CPoint
+ // l'objet doit être de la classe CPoint
if ( !pThis->IsElemOfClass("CPoint") ) return 6021;
- // ok si aucun param�tres !
+ // ok si aucun paramètres !
if ( pVar == NULL ) return 0;
- // param�tre de type num�rique svp
+ // paramètre de type numérique svp
if ( pVar->RetType() > CBotTypDouble ) return 6023;
pVar = pVar->RetNext();
- // il doit y avoir un second param�tre
+ // il doit y avoir un second paramètre
if ( pVar == NULL ) return 6022;
- // �galement de type num�rique
+ // également de type numérique
if ( pVar->RetType() > CBotTypDouble )return 6023;
pVar = pVar->RetNext();
- // et pas plus de 2 param�tres svp
+ // et pas plus de 2 paramètres svp
if ( pVar != NULL ) return 6025;
return 0; // cette fonction retourne void
}
-// m�thode d�terminant l'oppos�
+// méthode déterminant l'opposé
BOOL rOppose( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
{
CString s;
- if ( pVar != NULL ) // pas de param�tre
+ if ( pVar != NULL ) // pas de paramètre
{
Exception = 6025; return FALSE;
}
- CBotVar* pvar = pThis->RetItemList(); // demande la cha�ne des items
+ CBotVar* pvar = pThis->RetItemList(); // demande la chaîne des items
- // tous les param�tres sont des nombres
+ // tous les paramètres sont des nombres
while (pvar != NULL)
{
pvar->SetValFloat( -pvar->RetValFloat() );
@@ -235,15 +222,15 @@ BOOL rOppose( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
int cOppose( CBotVar* pThis, CBotVar* &pVar, CBotString& RetClass)
{
- // l'objet doit �tre de la classe CPoint
+ // l'objet doit être de la classe CPoint
if ( !pThis->IsElemOfClass("CPoint") ) return 6021;
RetClass = "CPoint"; // l'objet rendu est de cette class
- // ok si aucun param�tres !
- if ( pVar == NULL ) return CBotTypClass; // le param�tre retourn� est une instance de la classe
+ // ok si aucun paramètres !
+ if ( pVar == NULL ) return CBotTypClass; // le paramètre retourné est une instance de la classe
- return TX_OVERPARAM; // �a va pas
+ return TX_OVERPARAM; // ça va pas
}
@@ -326,7 +313,7 @@ BOOL CTstCBotApp::InitInstance()
///////////////////////////////////
-// d�fini la fonction "show()"
+// défini la fonction "show()"
// --------------------------------
CBotProgram::AddFunction("show", rShow, cShow);
@@ -336,7 +323,7 @@ BOOL CTstCBotApp::InitInstance()
///////////////////////////////////
-// d�finie la classe globale CPoint
+// définie la classe globale CPoint
// --------------------------------
CBotClass* m_pClassPoint;
@@ -349,8 +336,8 @@ BOOL CTstCBotApp::InitInstance()
// ajoute le constructeur pour cette classe
m_pClassPoint->AddFunction("CPoint", rCPoint, cCPoint);
- // ajoute la m�thode Oppos�
- m_pClassPoint->AddFunction("Oppos�", rOppose, cOppose);
+ // ajoute la méthode Opposé
+ m_pClassPoint->AddFunction("Opposé", rOppose, cOppose);
//////////////////////////////////////////////////////////////////
@@ -361,7 +348,7 @@ BOOL CTstCBotApp::InitInstance()
CBotStringArray Liste;
p->Compile(" public void MonProgram( ) { show (\"mon programme\") ;}", Liste );
- // l'objet n'est pas d�truit et plus r�f�renc�
+ // l'objet n'est pas détruit et plus référencé
// je sais c'est pas bien