diff options
author | Krzysztof H <krzys_h@interia.pl> | 2012-03-19 12:44:39 +0100 |
---|---|---|
committer | Krzysztof H <krzys_h@interia.pl> | 2012-03-19 12:44:39 +0100 |
commit | f7d892cf4ef6bfce3747c4b6a810d4828b79833d (patch) | |
tree | 8311c7057b5f861c387ecc8c96cd778abc47c8d8 /src/CBot/TestCBot | |
parent | 343cb0ce660136ac034e6106c0f151466b751398 (diff) | |
download | colobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.tar.gz colobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.tar.bz2 colobot-f7d892cf4ef6bfce3747c4b6a810d4828b79833d.zip |
Last coding fix ;)
Diffstat (limited to 'src/CBot/TestCBot')
-rw-r--r-- | src/CBot/TestCBot/CBotConsoleDlg.cpp | 9 | ||||
-rw-r--r-- | src/CBot/TestCBot/CBotConsoleDlg.h | 5 | ||||
-rw-r--r-- | src/CBot/TestCBot/ChildFrm.cpp | 5 | ||||
-rw-r--r-- | src/CBot/TestCBot/ChildFrm.h | 6 | ||||
-rw-r--r-- | src/CBot/TestCBot/MainFrm.cpp | 5 | ||||
-rw-r--r-- | src/CBot/TestCBot/MainFrm.h | 6 | ||||
-rw-r--r-- | src/CBot/TestCBot/PerformDlg.cpp | 9 | ||||
-rw-r--r-- | src/CBot/TestCBot/PerformDlg.h | 5 | ||||
-rw-r--r-- | src/CBot/TestCBot/Routines.cpp | 29 | ||||
-rw-r--r-- | src/CBot/TestCBot/StdAfx.cpp | 6 | ||||
-rw-r--r-- | src/CBot/TestCBot/StdAfx.h | 7 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBot.cpp | 17 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBot.h | 5 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBotDoc.cpp | 43 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBotDoc.h | 10 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBotView.cpp | 7 | ||||
-rw-r--r-- | src/CBot/TestCBot/TestCBotView.h | 6 | ||||
-rw-r--r-- | src/CBot/TestCBot/až1.txt | 96 | ||||
-rw-r--r-- | src/CBot/TestCBot/resource.h | 7 |
19 files changed, 200 insertions, 83 deletions
diff --git a/src/CBot/TestCBot/CBotConsoleDlg.cpp b/src/CBot/TestCBot/CBotConsoleDlg.cpp index a6056df..2305bf3 100644 --- a/src/CBot/TestCBot/CBotConsoleDlg.cpp +++ b/src/CBot/TestCBot/CBotConsoleDlg.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// CBotConsoleDlg.cpp : implementation file
+//
#include "stdafx.h"
#include "TestCBot.h"
@@ -117,7 +118,7 @@ UINT ThreadProc(ThreadInfo *info) CTimeSpan ts = t - t0;
char buffer[200];
- sprintf( buffer, "\r\nEx�cution termin�e en %d secondes.\r\nInterrompue %d fois.\r\n",
+ sprintf( buffer, "\r\nExécution terminée en %d secondes.\r\nInterrompue %d fois.\r\n",
ts.GetTotalSeconds(), Cpt);
info->m_pEdit1->ReplaceSel(buffer);
@@ -181,7 +182,7 @@ void CBotConsoleDlg::OnOK() m_Edit2.EnableWindow(FALSE);
m_cOK.EnableWindow(FALSE);
- // lance un processus paral�le pour l'ex�cution
+ // lance un processus paralèle pour l'exécution
m_threadinfo.m_pWndMessage = this ;
m_threadinfo.m_pEdit1 = &m_Edit1;
diff --git a/src/CBot/TestCBot/CBotConsoleDlg.h b/src/CBot/TestCBot/CBotConsoleDlg.h index f87e168..52a6e16 100644 --- a/src/CBot/TestCBot/CBotConsoleDlg.h +++ b/src/CBot/TestCBot/CBotConsoleDlg.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,8 +12,7 @@ // * 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/.
-#if !defined(AFX_BOTCONSOLEDLG_H__A11450A2_8E09_11D4_A439_00D059085115__INCLUDED_)
+// * along with this program. If not, see http://www.gnu.org/licenses/.#if !defined(AFX_BOTCONSOLEDLG_H__A11450A2_8E09_11D4_A439_00D059085115__INCLUDED_)
#define AFX_BOTCONSOLEDLG_H__A11450A2_8E09_11D4_A439_00D059085115__INCLUDED_
#if _MSC_VER >= 1000
diff --git a/src/CBot/TestCBot/ChildFrm.cpp b/src/CBot/TestCBot/ChildFrm.cpp index 36a76d5..eb7f2b7 100644 --- a/src/CBot/TestCBot/ChildFrm.cpp +++ b/src/CBot/TestCBot/ChildFrm.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// ChildFrm.cpp : implementation of the CChildFrame class
+//
#include "stdafx.h"
#include "TestCBot.h"
diff --git a/src/CBot/TestCBot/ChildFrm.h b/src/CBot/TestCBot/ChildFrm.h index 04ee783..d8918d4 100644 --- a/src/CBot/TestCBot/ChildFrm.h +++ b/src/CBot/TestCBot/ChildFrm.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,9 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// ChildFrm.h : interface of the CChildFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__4D1BB909_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_CHILDFRM_H__4D1BB909_8E74_11D4_A439_00D059085115__INCLUDED_
diff --git a/src/CBot/TestCBot/MainFrm.cpp b/src/CBot/TestCBot/MainFrm.cpp index d0ab4c6..c3f6b9f 100644 --- a/src/CBot/TestCBot/MainFrm.cpp +++ b/src/CBot/TestCBot/MainFrm.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// MainFrm.cpp : implementation of the CMainFrame class
+//
#include "stdafx.h"
#include "TestCBot.h"
diff --git a/src/CBot/TestCBot/MainFrm.h b/src/CBot/TestCBot/MainFrm.h index 1bdf61b..0c4e737 100644 --- a/src/CBot/TestCBot/MainFrm.h +++ b/src/CBot/TestCBot/MainFrm.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,9 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// MainFrm.h : interface of the CMainFrame class
+//
+/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__4D1BB907_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_MAINFRM_H__4D1BB907_8E74_11D4_A439_00D059085115__INCLUDED_
diff --git a/src/CBot/TestCBot/PerformDlg.cpp b/src/CBot/TestCBot/PerformDlg.cpp index af855d7..f5ccd7b 100644 --- a/src/CBot/TestCBot/PerformDlg.cpp +++ b/src/CBot/TestCBot/PerformDlg.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// PerformDlg.cpp : implementation file
+//
#include "stdafx.h"
#include "testcbot.h"
@@ -135,7 +136,7 @@ BOOL CPerformDlg::OnInitDialog() CBotStringArray liste;
- // cr�e les scripts pour les tests
+ // crée les scripts pour les tests
for ( int i = 0; i < 100; i++ )
{
m_pProg[i] = new CBotProgram();
@@ -143,7 +144,7 @@ BOOL CPerformDlg::OnInitDialog() m_pProg[i]->Start(liste[0]);
}
- // lance un processus paral�le pour l'ex�cution
+ // lance un processus paralèle pour l'exécution
// m_threadinfo2.m_pWndMessage = this ;
m_threadinfo2.m_pEdit = &m_Edit1;
diff --git a/src/CBot/TestCBot/PerformDlg.h b/src/CBot/TestCBot/PerformDlg.h index e83f542..6a9a845 100644 --- a/src/CBot/TestCBot/PerformDlg.h +++ b/src/CBot/TestCBot/PerformDlg.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,8 +12,7 @@ // * 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/.
-#if !defined(AFX_PERFORMDLG_H__EAF2D560_97D8_11D4_A439_00D059085115__INCLUDED_)
+// * along with this program. If not, see http://www.gnu.org/licenses/.#if !defined(AFX_PERFORMDLG_H__EAF2D560_97D8_11D4_A439_00D059085115__INCLUDED_)
#define AFX_PERFORMDLG_H__EAF2D560_97D8_11D4_A439_00D059085115__INCLUDED_
#if _MSC_VER >= 1000
diff --git a/src/CBot/TestCBot/Routines.cpp b/src/CBot/TestCBot/Routines.cpp index 77808e2..b37f027 100644 --- a/src/CBot/TestCBot/Routines.cpp +++ b/src/CBot/TestCBot/Routines.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -14,12 +14,11 @@ // * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/.
-
////////////////////////////////////////////////////////////////////
// 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, void* pUser )
{
CString s;
@@ -47,15 +46,15 @@ BOOL rShow( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser ) CBotTypResult cShow( CBotVar* &pVar, void* pUser)
{
if ( pVar == NULL ) return CBotTypResult(5028);
- return CBotTypResult(0); // tous param�tres accept�s, void en retour
+ return CBotTypResult(0); // tous paramètres acceptés, void en retour
}
////////////////////////////////////////////////////////////////////
// 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, void* pUser )
{
CString s;
@@ -105,19 +104,19 @@ BOOL rPrint( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser ) CBotTypResult cPrint( CBotVar* &pVar, void* pUser)
{
- return CBotTypResult(0); // tous param�tres accept�s, un entier en retour
+ return CBotTypResult(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
CBotVar* pX = pThis->GivItem("x");
pX->SetValFloat( pVar->GivValFloat() );
@@ -132,20 +131,20 @@ BOOL rCPoint( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception ) CBotTypResult cCPoint( CBotVar* pThis, CBotVar* &pVar)
{
- // ok si aucun param�tres !
+ // ok si aucun paramètres !
if ( pVar == NULL ) return CBotTypResult(0);
- // param�tre de type num�rique svp
+ // paramètre de type numérique svp
if ( pVar->GivType() > CBotTypDouble ) return CBotTypResult(5011);
pVar = pVar->GivNext();
- // il doit y avoir un second param�tre
+ // il doit y avoir un second paramètre
if ( pVar == NULL ) return 5028;
- // �galement de type num�rique
+ // également de type numérique
if ( pVar->GivType() > CBotTypDouble )return CBotTypResult(5011);
pVar = pVar->GivNext();
- // et pas plus de 2 param�tres svp
+ // et pas plus de 2 paramètres svp
if ( pVar != NULL ) return CBotTypResult(5026);
return CBotTypResult(0); // cette fonction retourne void
diff --git a/src/CBot/TestCBot/StdAfx.cpp b/src/CBot/TestCBot/StdAfx.cpp index a3471af..7dd0f00 100644 --- a/src/CBot/TestCBot/StdAfx.cpp +++ b/src/CBot/TestCBot/StdAfx.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,9 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// stdafx.cpp : source file that includes just the standard includes
+// TestCBot.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
diff --git a/src/CBot/TestCBot/StdAfx.h b/src/CBot/TestCBot/StdAfx.h index 8f3f644..c3659fb 100644 --- a/src/CBot/TestCBot/StdAfx.h +++ b/src/CBot/TestCBot/StdAfx.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,10 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
#if !defined(AFX_STDAFX_H__4D1BB905_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_STDAFX_H__4D1BB905_8E74_11D4_A439_00D059085115__INCLUDED_
diff --git a/src/CBot/TestCBot/TestCBot.cpp b/src/CBot/TestCBot/TestCBot.cpp index afebeac..a76040a 100644 --- a/src/CBot/TestCBot/TestCBot.cpp +++ b/src/CBot/TestCBot/TestCBot.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBot.cpp : Defines the class behaviors for the application.
+//
#include "stdafx.h"
#include "TestCBot.h"
@@ -68,7 +69,7 @@ static char BASED_CODE szFilename[] = "File1"; #include "../ClassFILE.cpp"
-// routine pour mettre � jour l'instance de la classe Bot courante
+// routine pour mettre à jour l'instance de la classe Bot courante
void rMajObject( CBotVar* pThis, void* pUser )
{
if (!pThis->IsElemOfClass("object"))
@@ -89,7 +90,7 @@ void rMajObject( CBotVar* pThis, void* pUser ) // pX = pThis->GivItem( "xx" );
// pX->SetValFloat( (float)22 );
- // cr�e une instance sur une classe object
+ // crée une instance sur une classe object
// CBotVar* pAutre = CBotVar::Create("autre", CBotTypClass, "object");
// pAutre->SetUserPtr( (void*)3 );
// pPt->SetPointer( pAutre );
@@ -101,13 +102,13 @@ void rMajObject( CBotVar* pThis, void* pUser ) BOOL CTestCBotApp::InitInstance()
{
//////////////////////////////////////////////
-// d�fini les mots clefs suppl�mentaires
+// défini les mots clefs supplémentaires
// -------------------------------------------
CBotProgram::Init();
//////////////////////////////////////////////
-// d�fini les fonctions "show()" et "print()"
+// défini les fonctions "show()" et "print()"
// -------------------------------------------
CBotProgram::AddFunction("show", rShow, cShow);
@@ -116,7 +117,7 @@ BOOL CTestCBotApp::InitInstance() ///////////////////////////////////
-// d�finie la classe globale CPoint
+// définie la classe globale CPoint
// --------------------------------
m_pClassPoint = new CBotClass("CPoint", NULL);
@@ -139,7 +140,7 @@ BOOL CTestCBotApp::InitInstance() // ajoute le constructeur pour cette classe
m_pClassPointIntr->AddFunction("point", rCPoint, cCPoint);
- // d�fini la classe "object"
+ // défini la classe "object"
CBotClass* pClassObject = new CBotClass( "object", NULL ) ;
pClassObject->AddItem( "xx", CBotTypFloat );
pClassObject->AddItem( "position", CBotTypResult( CBotTypIntrinsic, "point" ) );
diff --git a/src/CBot/TestCBot/TestCBot.h b/src/CBot/TestCBot/TestCBot.h index 4067423..b3b15db 100644 --- a/src/CBot/TestCBot/TestCBot.h +++ b/src/CBot/TestCBot/TestCBot.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBot.h : main header file for the TESTCBOT application
+//
#if !defined(AFX_TESTCBOT_H__4D1BB903_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_TESTCBOT_H__4D1BB903_8E74_11D4_A439_00D059085115__INCLUDED_
diff --git a/src/CBot/TestCBot/TestCBotDoc.cpp b/src/CBot/TestCBot/TestCBotDoc.cpp index 44d88a9..fdb8604 100644 --- a/src/CBot/TestCBot/TestCBotDoc.cpp +++ b/src/CBot/TestCBot/TestCBotDoc.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBotDoc.cpp : implementation of the CTestCBotDoc class
+//
#include "stdafx.h"
#include "TestCBot.h"
@@ -138,7 +139,7 @@ void CTestCBotDoc::OnRun() m_pProg = NULL;
m_pEdit->SetSel( start, end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
TextError = CBotProgram::GivErrorText( code );
AfxMessageBox( TextError );
@@ -149,7 +150,7 @@ void CTestCBotDoc::OnRun() if( m_Liste.GivSize() == 0 )
{
- AfxMessageBox("Aucune fonction marqu�e \"extern\" !");
+ AfxMessageBox("Aucune fonction marquée \"extern\" !");
return;
}
@@ -173,7 +174,7 @@ void CTestCBotDoc::OnRun() TextError = m_pProg->GivErrorText( dlg.m_code );
m_pEdit->SetSel( dlg.m_start, dlg.m_end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
AfxMessageBox(TextError);
}
@@ -200,7 +201,7 @@ BOOL CTestCBotDoc::Compile() if ( m_pProg == NULL ) m_pProg = new CBotProgram();
char buffer[100];
- strcpy(buffer, "le pointeur � passer pour voir");
+ strcpy(buffer, "le pointeur à passer pour voir");
if (m_bModified && !m_pProg->Compile(m_DocText, m_Liste, (void*)buffer))
{
@@ -209,7 +210,7 @@ BOOL CTestCBotDoc::Compile() m_pProg = NULL;
m_pEdit->SetSel( start, end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
TextError = CBotProgram::GivErrorText( code );
AfxMessageBox( TextError );
@@ -222,7 +223,7 @@ BOOL CTestCBotDoc::Compile() if ( m_pProg->GetPosition( "TheTest", start, end) )
{
m_pEdit->SetSel( start, end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
}
m_bModified = FALSE;
@@ -232,7 +233,7 @@ BOOL CTestCBotDoc::Compile() static int compt = 0;
-// routine retournant le "pointeur" � un autre object
+// routine retournant le "pointeur" à un autre object
BOOL rRetObject( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
{
pResult->SetPointer( NULL );
@@ -331,7 +332,7 @@ CBotTypResult cRadar( CBotVar* &pVar, void* pUser ) return CBotTypResult( CBotTypPointer, "object");
}
-// routine retournant le "pointeur" � un autre object
+// routine retournant le "pointeur" à un autre object
BOOL rTEST( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
{
test = 1 ;
@@ -351,7 +352,7 @@ CBotTypResult cTEST( CBotVar* &pVar, void* pUser ) return CBotTypResult( 0 );
}
-// routine retournant le "pointeur" � un autre object
+// routine retournant le "pointeur" à un autre object
BOOL rF( CBotVar* pVar, CBotVar* pResult, int& ex, void* pUser )
{
if ( pResult == NULL ) return TRUE;
@@ -366,7 +367,7 @@ CBotTypResult cF( CBotVar* &pVar, void* pUser ) /////////////////////////////////////////////////////////////////
-// Compilation d'une proc�dure avec un "point".
+// Compilation d'une procédure avec un "point".
CBotTypResult cPoint(CBotVar* &var, void* user)
{
@@ -394,7 +395,7 @@ CBotTypResult cPoint(CBotVar* &var, void* user) return CBotTypResult( CBotErrBadParam );
}
-// Donne un param�tre de type "point".
+// Donne un paramètre de type "point".
#define UNIT 1
@@ -508,13 +509,13 @@ void CTestCBotDoc::OnTest() // dlg.m_Script = m_DocText;
// dlg.DoModal();
- // d�fini la routine RetObject
+ // défini la routine RetObject
CBotProgram::AddFunction( "Radar", rRetObject, cRetObject );
// ajoute une routine pour cette classe
CBotProgram::AddFunction("Space", rSpace, cSpace);
- // d�fini la routine Test
+ // défini la routine Test
CBotProgram::AddFunction( "TEST", rTEST, cTEST );
CBotProgram::AddFunction( "F", rF, cF );
@@ -522,13 +523,13 @@ void CTestCBotDoc::OnTest() CBotProgram::AddFunction( "fire", rTurn, cTurn );
CBotProgram::AddFunction( "radar", rRadar, cRadar );
- // cr�e une instance de la classe "Bot" pour ce robot
+ // crée une instance de la classe "Bot" pour ce robot
CBotVar* pThisRobot = CBotVar::Create( "", CBotTypResult(CBotTypClass, "object") );
pThisRobot->SetUserPtr( (void*)1 );
pThisRobot->SetIdent( 1234 );
delete m_pProg;
- // cr�e un objet programme associ� � cette instance
+ // crée un objet programme associé à cette instance
m_pProg = new CBotProgram(pThisRobot);
// compile le programme
@@ -545,7 +546,7 @@ void CTestCBotDoc::OnTest() delete pThisRobot;
m_pEdit->SetSel( start, end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
TextError = CBotProgram::GivErrorText( code );
AfxMessageBox( TextError );
@@ -554,14 +555,14 @@ void CTestCBotDoc::OnTest() return;
}
- // ex�cute pour voir
+ // exécute pour voir
m_pProg->Start(m_Liste[0]);
int mode = -1;
if ( mode >= 0 ) {
- // sauve et restore � chaque pas possible
+ // sauve et restore à chaque pas possible
while (!m_pProg->Run(NULL, 1))
{
const char* FunctionName;
@@ -588,7 +589,7 @@ if ( mode == 2 ) if (!m_pProg->Compile(m_DocText, m_Liste, (void*) 44)) delete pThisRobot;
m_pEdit->SetSel( start, end );
- m_pEdit->SetFocus(); // met en �vidence la partie avec probl�me
+ m_pEdit->SetFocus(); // met en évidence la partie avec problème
TextError = CBotProgram::GivErrorText( code );
AfxMessageBox( TextError );
diff --git a/src/CBot/TestCBot/TestCBotDoc.h b/src/CBot/TestCBot/TestCBotDoc.h index d80a397..548607f 100644 --- a/src/CBot/TestCBot/TestCBotDoc.h +++ b/src/CBot/TestCBot/TestCBotDoc.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,9 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBotDoc.h : interface of the CTestCBotDoc class
+//
+/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_TESTCBOTDOC_H__4D1BB90B_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_TESTCBOTDOC_H__4D1BB90B_8E74_11D4_A439_00D059085115__INCLUDED_
@@ -30,8 +32,8 @@ protected: // create from serialization only // Attributes
public:
- CEdit* m_pEdit; // pour m�moriser le texte, et l'afficher
- CBotProgram* m_pProg; // le programme compil�
+ CEdit* m_pEdit; // pour mémoriser le texte, et l'afficher
+ CBotProgram* m_pProg; // le programme compilé
CString m_DocText;
CBotStringArray m_Liste;
BOOL m_bModified;
diff --git a/src/CBot/TestCBot/TestCBotView.cpp b/src/CBot/TestCBot/TestCBotView.cpp index 7f531e5..e4710cb 100644 --- a/src/CBot/TestCBot/TestCBotView.cpp +++ b/src/CBot/TestCBot/TestCBotView.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,8 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBotView.cpp : implementation of the CTestCBotView class
+//
#include "stdafx.h"
#include "TestCBot.h"
@@ -106,7 +107,7 @@ void CTestCBotView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* if ( !bActivate && !pDoc->Compile() )
{
-// comment faire pour r�activer l'ancien document
+// comment faire pour réactiver l'ancien document
}
CView::OnActivateView(bActivate, pActivateView, pDeactiveView);
diff --git a/src/CBot/TestCBot/TestCBotView.h b/src/CBot/TestCBot/TestCBotView.h index 14de389..065ee08 100644 --- a/src/CBot/TestCBot/TestCBotView.h +++ b/src/CBot/TestCBot/TestCBotView.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,9 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.// TestCBotView.h : interface of the CTestCBotView class
+//
+/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_TESTCBOTVIEW_H__4D1BB90D_8E74_11D4_A439_00D059085115__INCLUDED_)
#define AFX_TESTCBOTVIEW_H__4D1BB90D_8E74_11D4_A439_00D059085115__INCLUDED_
diff --git a/src/CBot/TestCBot/až1.txt b/src/CBot/TestCBot/až1.txt new file mode 100644 index 0000000..165bc95 --- /dev/null +++ b/src/CBot/TestCBot/až1.txt @@ -0,0 +1,96 @@ +object radarGuepe(point orig, float dist) +{ + int i; + object pr, r; + float mindist; + + i = 0; + mindist = 1000; + while (i<30) + { + pr = radar(i); + if (pr != null) + { + + if (F(orig, pr.position) < mindist and pr.category == AlienWasp and pr.altitude > 3) + { + mindist = distance(orig, pr.position); + r = pr; + } + } + i = i+1; + } + if (mindist < dist) return(r); else return(null); +} + + +class Guepe +{ + + point pos; + + + void cherche(point orig, float dist) + { + object p; + point o; + + p = radarGuepe(orig, dist); + while (p == null) + { + wait(0.1); + p = radarGuepe(orig, dist); + } + + pos.x = p.position.x; + pos.y = p.position.y; + pos.z = p.position.z; + + //o = p.position; + //wait(0.1); + + //vitessex = (p.position.x - o.x)/0.1; + //vitessey = (p.position.y - o.y)/0.1; + //vitessez = (p.position.z - o.z)/0.1; + + } + + + void tire(point orig, float orient) + { + //float t = 3; //temps d'anticipation + float angle; + point cible; + + cible.x = pos.x;// + t*vitessex; + cible.y = pos.y;// + t*vitessey; + cible.z = pos.z;// + t*vitessez; + + if (cible.x == 0) angle = 90; else + angle = atan(cible.y / cible.x); + if (cible.x < 0) angle = angle + 180; + angle = angle - orient; + if (angle > 180) angle = angle - 360; + if (angle < -180) angle = angle + 360; + turn(angle); + + angle = atan((cible.z-orig.z) / distance2d(orig, cible)); + aim(angle); + + fire(0.1); + + } +} + +extern void object::Fourmi6() +{ + //fps(1000); + Guepe guepe = new Guepe(); + + while (true) + { + guepe.cherche(position, 50); + + guepe.tire(position, orientation); + } +} diff --git a/src/CBot/TestCBot/resource.h b/src/CBot/TestCBot/resource.h index 0797131..d661201 100644 --- a/src/CBot/TestCBot/resource.h +++ b/src/CBot/TestCBot/resource.h @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code
+// * 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
@@ -12,7 +12,10 @@ // * 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/.
+// * along with this program. If not, see http://www.gnu.org/licenses/.//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by TestCBot.rc
+//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_TESTCBTYPE 129
|