summaryrefslogtreecommitdiffstats
path: root/src/CBot/tests/CBot_console
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-02-03 20:03:36 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2013-02-03 20:03:36 +0100
commit209c6412ae149cc7c503fd7da384f344a830423c (patch)
tree5baeaeb8dee2208b46bf80a118dfe59eb65f9389 /src/CBot/tests/CBot_console
parent3f41f97fc47fca22634dc858c3ecdb39d0d27e32 (diff)
downloadcolobot-209c6412ae149cc7c503fd7da384f344a830423c.tar.gz
colobot-209c6412ae149cc7c503fd7da384f344a830423c.tar.bz2
colobot-209c6412ae149cc7c503fd7da384f344a830423c.zip
Refactoring in tests infrastructure
* all tests are now in /test/ subdirectory * unit tests concatenated to one executable (TODO: ui, common) * preparation for test environments (OpenGL and others) * removed old TestCBot
Diffstat (limited to 'src/CBot/tests/CBot_console')
-rw-r--r--src/CBot/tests/CBot_console/CMakeLists.txt17
l---------src/CBot/tests/CBot_console/src/CBot1
-rw-r--r--src/CBot/tests/CBot_console/src/CMakeLists.txt32
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotConsole.cpp175
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotConsole.h44
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotDoc.cpp122
-rw-r--r--src/CBot/tests/CBot_console/src/app/CBotDoc.h39
-rw-r--r--src/CBot/tests/CBot_console/src/app/CClass.cpp97
-rw-r--r--src/CBot/tests/CBot_console/src/app/CClass.h18
-rw-r--r--src/CBot/tests/CBot_console/src/app/main.cpp45
-rw-r--r--src/CBot/tests/CBot_console/src/app/routines.cpp141
11 files changed, 0 insertions, 731 deletions
diff --git a/src/CBot/tests/CBot_console/CMakeLists.txt b/src/CBot/tests/CBot_console/CMakeLists.txt
deleted file mode 100644
index f76dedf..0000000
--- a/src/CBot/tests/CBot_console/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-project(CBot_console C CXX)
-
-# Build with debugging symbols
-if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE debug)
-endif(NOT CMAKE_BUILD_TYPE)
-
-# Global compile flags
-set(CMAKE_CXX_FLAGS_RELEASE "-O2")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
-
-# Include cmake directory
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${colobot_SOURCE_DIR}/cmake")
-
-add_subdirectory(src bin)
diff --git a/src/CBot/tests/CBot_console/src/CBot b/src/CBot/tests/CBot_console/src/CBot
deleted file mode 120000
index 2c91115..0000000
--- a/src/CBot/tests/CBot_console/src/CBot
+++ /dev/null
@@ -1 +0,0 @@
-../../../../CBot/ \ No newline at end of file
diff --git a/src/CBot/tests/CBot_console/src/CMakeLists.txt b/src/CBot/tests/CBot_console/src/CMakeLists.txt
deleted file mode 100644
index 3dbf711..0000000
--- a/src/CBot/tests/CBot_console/src/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# CBot shared library is built separately
-add_subdirectory(CBot)
-
-
-# Configure options
-option(DEBUG "Enable debug output" ON)
-
-set(PLATFORM_LIBS "")
-
-# Source files
-# Commented out files are still dependent on DirectX or WinAPI
-
-set(SOURCES
-app/CClass.cpp
-app/main.cpp
-#app/routines.cpp
-app/CBotDoc.cpp
-app/CBotConsole.cpp
-)
-
-set(LIBS
-CBot
-)
-
-include_directories(. ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-link_directories(${CMAKE_CURRENT_SOURCE_DIR}/CBot)
-
-add_executable(CBot_console ${SOURCES})
-
-target_link_libraries(CBot_console ${LIBS})
diff --git a/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp b/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp
deleted file mode 100644
index e9209d3..0000000
--- a/src/CBot/tests/CBot_console/src/app/CBotConsole.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * CBotConsole.cpp
- *
- * Created on: 08-08-2012
- * Author: michal
- */
-
-#include "CBotConsole.h"
-#include "CClass.h"
-#include <ctime>
-#include <iostream>
-
-CBotConsole::CBotConsole() {
- // TODO Auto-generated constructor stub
- m_pProg = NULL;
- m_threadinfo.m_bRun = false;
- m_code = 0;
-
-}
-
-CBotConsole::~CBotConsole() {
- // TODO Auto-generated destructor stub
-}
-
-uint ThreadProc(ThreadInfo *info)
-{
- time_t t0,t1;
- time(&t0);
-
- int Cpt = 0;
-
- info->m_pProg->Start("LaCommande");
- while ( !info->m_bStop && !info->m_pProg->Run() )
- {
-#if 0
- const char* FunctionName;
- const char* FN;
- int start, end;
-
- info->m_pProg->GetRunPos(FunctionName, start, end);
-
- if ( FunctionName != NULL )
- {
- info->m_pEditx->SetSel(start, end);
-
- char buffer[200];
- sprintf( buffer, "step %s, %d, %d",FunctionName, start, end);
- AfxMessageBox( buffer );
-
- int level = 0;
- do
- {
- CBotVar* t = info->m_pProg->GetStackVars(FN, level--);
- if ( FN != FunctionName ) break;
- if ( t != NULL )
- {
- CString s ;
- while ( t != NULL )
- {
- if (s.IsEmpty()) s+= "Stack -> ";
- else s+= " , ";
- s += t->GetValString();
- t = t->GetNext();
- }
- AfxMessageBox(s);
- }
- } while (TRUE);
- }
-#endif
- Cpt++;
- if ( Cpt%50 == 0 ) std::cout << ".";
- }
-
- if ( info->m_bStop )
- {
- std::cout << "\nInterrupt\n";
- }
- else if (info->m_pProg->GetError() == 0)
- {
- time(&t1);
- double prog_time = difftime(t0,t1);
-
- char buffer[200];
- sprintf( buffer, "\nExecution terminated in %f seconds.\nInterrupted %d time(s).\n",
- prog_time, Cpt);
-
- std::cout << buffer;
- }
-
-// info->m_pWndMessage->SendMessage(WM_ENDPROG, 0, 0) ;
- return 0 ;
-}
-
-long CBotConsole::EndProg()
-{
- m_threadinfo.m_bRun = false;
-
- if (m_pProg->GetError(m_code, m_start, m_end))
- {
- CBotString TextError;
- TextError = CBotProgram::GetErrorText(m_code);
- std::cout << TextError;
- return 1;
- }
- delete m_pProg;
- m_pProg = NULL;
-
- return 0 ;
-}
-
-
-void CBotConsole::OnOK()
-{
- m_code = 0;
-
- std::string Commande;
- std::cin >> Commande;
-
- std::string s = "void LaCommande() { " + Commande + " ;}";
- m_pProg = new CBotProgram();
- CBotStringArray liste;
- m_pProg->Compile(s.c_str(), liste);
-
- int err, start, end;
- if ( m_pProg->GetError(err, start, end) )
- {
- CBotString TextError;
- TextError = CBotProgram::GetErrorText(err);
- std::cout << TextError;
- return;
- }
-
- std::cout << "\n" + Commande + " ->\n";
-
-// m_Edit2.SetWindowText("");
-// m_Edit1.SetFocus();
-// m_Edit2.EnableWindow(FALSE);
-// m_cOK.EnableWindow(FALSE);
-
- // lance un processus paralèle pour l'exécution
-// m_threadinfo.m_pWndMessage = this ;
-
-// m_threadinfo.m_pEdit1 = &m_Edit1;
-// m_threadinfo.m_pEditx = m_pEditx;
- m_threadinfo.m_pProg = m_pProg;
- m_threadinfo.m_bStop = false;
- m_threadinfo.m_bRun = true;
-
- ThreadProc(&m_threadinfo);
-
-// here program starts
-// AfxBeginThread((AFX_THREADPROC)ThreadProc, &m_threadinfo) ;
-}
-
-void CBotConsole::OnCancel()
-{
- m_threadinfo.m_bStop = true ;
-}
-
-bool CBotConsole::OnInitDialog()
-{
-// CDialog::OnInitDialog();
-
- std::cout << "Following functions are availible:\n";
- for ( int i = 0; i < m_pListe->GetSize(); i++ )
- {
- CBotString x = (*m_pListe)[i] + CBotString("\n");
- std::cout << x;
- }
- std::cout << "Enter a command:\n";
-
-
- return true; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
diff --git a/src/CBot/tests/CBot_console/src/app/CBotConsole.h b/src/CBot/tests/CBot_console/src/app/CBotConsole.h
deleted file mode 100644
index a155399..0000000
--- a/src/CBot/tests/CBot_console/src/app/CBotConsole.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * CBotConsole.h
- *
- * Created on: 08-08-2012
- * Author: michal
- */
-
-#ifndef CBOTCONSOLE_H_
-#define CBOTCONSOLE_H_
-#include "CClass.h"
-
-struct ThreadInfo
-{
-// CEdit* m_pEdit1 ;
-// CEdit* m_pEditx ;
- CBotProgram* m_pProg;
-// CWnd* m_pWndMessage;
- bool m_bStop;
- bool m_bRun;
-};
-
-class CBotConsole {
-
-public:
- CBotConsole();
- virtual ~CBotConsole();
-
-// CEdit m_Edit1;
-
- CBotProgram* m_pProg;
- ThreadInfo m_threadinfo;
-
- CBotStringArray* m_pListe;
- int m_code, m_start, m_end;
-// CEdit* m_pEditx;
-
- // Implementation
- void OnOK();
- void OnCancel();
- bool OnInitDialog();
- long EndProg() ;
-};
-
-#endif /* CBOTCONSOLE_H_ */
diff --git a/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp b/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp
deleted file mode 100644
index 1c694c9..0000000
--- a/src/CBot/tests/CBot_console/src/app/CBotDoc.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * CBotDoc.cpp
- *
- * Created on: 08-08-2012
- * Author: michal
- */
-#include "CBotDoc.h"
-#include "CBotConsole.h"
-#include <iostream>
-
-CBotDoc::CBotDoc(std::string s) {
- // TODO Auto-generated constructor stub
- // TODO set m_DocText
-// m_pEdit = NULL;
- m_pProg = NULL;
-// m_bModified = FALSE;
- m_DocText = s;
- std::cout << s << std::endl;
-// std::cout << "Enter to continue..." << std::endl;
-// getchar();
-}
-
-CBotDoc::~CBotDoc() {
-
-// delete m_pEdit;
- delete m_pProg;
-}
-
-
-//static bool test = false;
-
-void CBotDoc::OnRun()
-{
-
-// m_pEdit->GetWindowText(m_DocText);
- CBotString s;
-
- std::string TextError;
- int code, start, end;
-
- if ( m_pProg == NULL ) m_pProg = new CBotProgram();
-
- if (!m_pProg->Compile(m_DocText.c_str(), m_Liste, NULL))
- {
- m_pProg->GetError(code, start, end);
- delete m_pProg;
- m_pProg = NULL;
-
- TextError = CBotProgram::GetErrorText( code );
- std::cout << TextError << std::endl;
- return;
- }
-
- if( m_Liste.GetSize() == 0 )
- {
- std::cout << "No function marked \"extern\" !\n";
- return;
- }
-
- for ( int i = 0; i < m_Liste.GetSize(); i++ )
- {
- int start, stop;
- m_pProg->GetPosition(m_Liste[i], start, stop, GetPosNom, GetPosParam);
- CBotString s(m_DocText.substr( start, stop-start ).c_str());
- m_Liste[i] = s;
- }
-// TODO
- CBotConsole dlg;
- dlg.m_pListe = &m_Liste;
-// dlg.m_pEditx = m_pEdit;
-
- dlg.OnInitDialog();
- dlg.OnOK();
- dlg.EndProg();
-// if ( dlg.m_code>0 )
-// {
-// std::string TextError;
-//
-// TextError = m_pProg->GetErrorText( dlg.m_code );
-//
-// std::cout <<TextError;
-// }
-
- return;
-}
-
-bool CBotDoc::Compile()
-{
-// m_pEdit->GetWindowText(m_DocText);
-
- std::string TextError;
- int code, start, end;
-
- if ( m_pProg == NULL ) m_pProg = new CBotProgram();
-
- char buffer[100];
- strcpy(buffer, "a pointer move to see");
-
- if (!m_pProg->Compile(m_DocText.c_str(), m_Liste, static_cast<void*>(buffer)))
- {
- m_pProg->GetError(code, start, end);
- delete m_pProg;
- m_pProg = NULL;
-
-// m_pEdit->SetSel( start, end );
-// m_pEdit->SetFocus(); // higlights part of problem
-
- TextError = CBotProgram::GetErrorText( code );
- std::cout << TextError ;
-
- return false;
- }
-
-// if ( m_pProg->GetPosition( "TheTest", start, end) )
-// {
-// m_pEdit->SetSel( start, end );
-// m_pEdit->SetFocus(); // higlights part of problem
-// }
-
-// m_bModified = FALSE;
- return true;
-}
diff --git a/src/CBot/tests/CBot_console/src/app/CBotDoc.h b/src/CBot/tests/CBot_console/src/app/CBotDoc.h
deleted file mode 100644
index c0a3e1d..0000000
--- a/src/CBot/tests/CBot_console/src/app/CBotDoc.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * CBotDoc.h
- *
- * Created on: 08-08-2012
- * Author: michal
- */
-
-#pragma once
-#ifndef CBOTDOC_H_
-#define CBOTDOC_H_
-
-#include "CClass.h"
-#include <string>
-
-class CBotDoc {
-
-public:
- CBotDoc(std::string);
- virtual ~CBotDoc();
-
-// CEdit* m_pEdit; // to memorize the text, and display
- CBotProgram* m_pProg; // the compiled program
- std::string m_DocText;
- CBotStringArray m_Liste;
-
-// Operations
-
- bool Compile();
-
-// virtual bool OnNewDocument();
-
- void OnRun();
- void OnChangeEdit1();
- void OnTest();
-
-};
-
-
-#endif /* CBOTDOC_H_ */
diff --git a/src/CBot/tests/CBot_console/src/app/CClass.cpp b/src/CBot/tests/CBot_console/src/app/CClass.cpp
deleted file mode 100644
index 9b7c842..0000000
--- a/src/CBot/tests/CBot_console/src/app/CClass.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "CClass.h"
-
-#include "routines.cpp"
-
-void rMajObject( CBotVar* pThis, void* pUser )
-{
- if (!pThis->IsElemOfClass("object"))
- return ;
- 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->GetValString();
-
-// pX->SetValFloat( pUser == (void*)1 ? (float)12.5 : (float)44.4 );
- pZ->SetValFloat( (float)0 );
- pY->SetValFloat( (float)-3.33 );
- pX->SetValFloat( pX->GetValFloat() + 10 ) ;
-
-// pX = pThis->GetItem( "xx" );
-// pX->SetValFloat( (float)22 );
-
- // crée une instance sur une classe object
-// CBotVar* pAutre = CBotVar::Create("autre", CBotTypClass, "object");
-// pAutre->SetUserPtr( (void*)3 );
-// pPt->SetPointer( pAutre );
-// pPt->SetPointer( NULL );
-// delete pAutre;
-};
-
-CClass::CClass()
-{
- m_pClassPoint= NULL;
-}
-
-bool CClass::InitInstance()
-{
-//////////////////////////////////////////////
-// défini les mots clefs supplémentaires
-// -------------------------------------------
-
- CBotProgram::Init();
-
-//////////////////////////////////////////////
-// défini les fonctions "show()" et "print()"
-// -------------------------------------------
-
- //CBotProgram::AddFunction("show", rShow, cShow);
- CBotProgram::AddFunction("print", rPrint, cPrint);
- CBotProgram::AddFunction("println", rPrintLn, cPrint);
-
-
-///////////////////////////////////
-// définie la classe globale CPoint
-// --------------------------------
-
- m_pClassPoint = new CBotClass("CPoint", NULL);
- // ajoute le composant ".x"
- m_pClassPoint->AddItem("x", CBotTypFloat);
- // ajoute le composant ".y"
- m_pClassPoint->AddItem("y", CBotTypFloat);
-
- // ajoute le constructeur pour cette classe
- m_pClassPoint->AddFunction("CPoint", rCPoint, cCPoint);
-
- m_pClassPointIntr = new CBotClass("point", NULL, true);
- // ajoute le composant ".x"
- m_pClassPointIntr->AddItem("x", CBotTypFloat);
- // ajoute le composant ".y"
- m_pClassPointIntr->AddItem("y", CBotTypFloat);
- // ajoute le composant ".z"
- m_pClassPointIntr->AddItem("z", CBotTypFloat);
-
- // ajoute le constructeur pour cette classe
- m_pClassPointIntr->AddFunction("point", rCPoint, cCPoint);
-
- // défini la classe "object"
- CBotClass* pClassObject = new CBotClass( "object", NULL ) ;
- pClassObject->AddItem( "xx", CBotTypFloat );
- pClassObject->AddItem( "position", CBotTypResult( CBotTypIntrinsic, "point" ) );
- pClassObject->AddItem( "transport", CBotTypResult( CBotTypPointer, "object" ) );
- pClassObject->AddUpdateFunc( rMajObject );
-
- InitClassFILE();
-
- return true;
-}
-
-void CClass::ExitInstance()
-{
- delete m_pFuncFile;
-
- CBotProgram::Free();
-
-}
diff --git a/src/CBot/tests/CBot_console/src/app/CClass.h b/src/CBot/tests/CBot_console/src/app/CClass.h
deleted file mode 100644
index da2c46c..0000000
--- a/src/CBot/tests/CBot_console/src/app/CClass.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include <CBot/CBot.h>
-#include <string>
-
-extern std::string s;
-
-class CClass
-{
-public:
- CClass();
-
- CBotClass* m_pClassPoint;
- CBotClass* m_pClassPointIntr;
-
- bool InitInstance();
- void ExitInstance();
-};
diff --git a/src/CBot/tests/CBot_console/src/app/main.cpp b/src/CBot/tests/CBot_console/src/app/main.cpp
deleted file mode 100644
index a2d3668..0000000
--- a/src/CBot/tests/CBot_console/src/app/main.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "CClass.h"
-#include "CBotDoc.h"
-#include <iostream>
-
-
-#include <fstream>
-
-std::string str;
-
-// routine to update the instance of the class Bot common
-
-int main(int argc, char* argv[])
-{
- CClass newclass;
- CBotDoc *botdoc;
- if (argc != 2)
- {
- std::cout << "Usage: "<<argv[0] << " <filename>" << std::endl;
- return 0;
- }
-
- std::ifstream in(argv[1]);
- std::cout << argv[1] << std::endl;
- if (!in.good())
- {
- std::cout << "Oh no, error!" << std::endl;
- return 1;
- }
-
- std::string contents((std::istreambuf_iterator<char>(in)),
- std::istreambuf_iterator<char>());
- str = contents;
-
- if(!newclass.InitInstance())
- {
- std::cerr << "Initialization not complete!" << std::endl;
- return 1;
- }
-
- botdoc = new CBotDoc(str);
-// std::cout << "Hello CBot!" << std::endl << s;
- botdoc->OnRun();
- delete botdoc;
- newclass.ExitInstance();
-}
diff --git a/src/CBot/tests/CBot_console/src/app/routines.cpp b/src/CBot/tests/CBot_console/src/app/routines.cpp
deleted file mode 100644
index 8b8a1d4..0000000
--- a/src/CBot/tests/CBot_console/src/app/routines.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-// * 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/.
-
-////////////////////////////////////////////////////////////////////
-// routine show()
-// utilisable depuis le programme écrit en CBot
-
-
-#include <iostream>
-#include <string>
-#include "CBot/ClassFILE.cpp"
-//std::string s;
-/*
-// execution
-bool rShow( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
-{
- string::string s;
-
- while ( pVar != NULL )
- {
- string::string ss;
-
- ss.LoadString( TX_TYPENAMES + pVar->GetType() );
- s += ss + " ";
-
- ss = pVar->GetName();
- if (ss.IsEmpty()) ss = "<sans nom>";
- s += ss + " = ";
-
- s += pVar->GetValString();
- s += "\n";
- pVar = pVar->GetNext();
- }
-
- AfxMessageBox(s, MB_OK|MB_ICONINFORMATION);
-
- return TRUE; // pas d'interruption
-}
-
-CBotTypResult cShow( CBotVar* &pVar, void* pUser)
-{
- if ( pVar == NULL ) return CBotTypResult(5028);
- return CBotTypResult(0); // tous paramètres acceptés, void en retour
-}
-
-*/
-
-////////////////////////////////////////////////////////////////////
-// routine print()
-// utilisable depuis le programme écrit en CBot
-
-// exécution
-
-bool rPrintLn( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
-{
- std::string s;
- while ( pVar != NULL )
- {
- if ( !s.empty() ) s += " ";
- s += pVar->GetValString();
- pVar = pVar->GetNext();
- }
- s += "\n";
-
- std::cout << s;
- return true; // pas d'interruption
-}
-
-bool rPrint( CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser )
-{
- std::string s;
- while ( pVar != NULL )
- {
- if ( !s.empty() ) s += " ";
- s += pVar->GetValString();
- pVar = pVar->GetNext();
- }
- s += " ";
- std::cout << s;
- return true; // pas d'interruption
-}
-
-CBotTypResult cPrint( CBotVar* &pVar, void* pUser)
-{
- return CBotTypResult(0); // tous paramètres acceptés, un entier en retour
-}
-
-
-//////////////////////////////////////////////////////////////////
-// class CPoint pour essayer
-
-// exécution
-bool rCPoint( CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception )
-{
- if ( pVar == NULL )return true; // constructor with no parameters is ok
-
- CBotVar* pX = pThis->GetItem("x");
- pX->SetValFloat( pVar->GetValFloat() );
- pVar = pVar->GetNext();
-
- CBotVar* pY = pThis->GetItem("y");
- pY->SetValFloat( pVar->GetValFloat() );
- pVar = pVar->GetNext();
-
- return true; // pas d'interruption
-}
-
-CBotTypResult cCPoint( CBotVar* pThis, CBotVar* &pVar)
-{
- // ok if no parameters!
- if ( pVar == NULL ) return CBotTypResult(0);
-
- // numeric type of parameter please
- 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->GetType() > CBotTypDouble )return CBotTypResult(5011);
- pVar = pVar->GetNext();
-
- // and not more than 2 parameters please
- if ( pVar != NULL ) return CBotTypResult(5026);
-
- return CBotTypResult(0); // This function returns void
-}
-