[colobot] 106/377: Moving CBotClass class in its own header and source files.
Didier Raboud
odyx at moszumanska.debian.org
Wed Mar 30 13:34:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit 77d738634c5eeb8b4f33441191d28da7fe3f27f7
Author: Grunaka <dev at romainbreton.fr>
Date: Sun Nov 15 17:37:53 2015 +0100
Moving CBotClass class in its own header and source files.
---
src/CBot/CBot.cpp | 1 +
src/CBot/CBotClass.cpp | 102 ++++++----
src/CBot/CBotClass.h | 328 ++++++++++++++++++++++++++++++++
src/CBot/CBotDll.h | 118 ------------
src/CBot/CBotFunction.cpp | 1 +
src/CBot/CBotInstr/CBotClassInst.cpp | 1 +
src/CBot/CBotInstr/CBotFieldExpr.cpp | 1 +
src/CBot/CBotInstr/CBotInstrMethode.cpp | 1 +
src/CBot/CBotInstr/CBotLeftExpr.cpp | 1 +
src/CBot/CBotInstr/CBotNew.cpp | 1 +
src/CBot/CBotProgram.cpp | 2 +-
src/CBot/CBotVar.cpp | 1 +
src/level/robotmain.cpp | 2 +
src/script/scriptfunc.cpp | 3 +
14 files changed, 408 insertions(+), 155 deletions(-)
diff --git a/src/CBot/CBot.cpp b/src/CBot/CBot.cpp
index 30f2246..76cfe2b 100644
--- a/src/CBot/CBot.cpp
+++ b/src/CBot/CBot.cpp
@@ -73,6 +73,7 @@
#include "CBotInstr/CBotInt.h"
#include "CBotStack.h"
+#include "CBotClass.h"
// Local include
diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp
index dc89797..9c18f2c 100644
--- a/src/CBot/CBotClass.cpp
+++ b/src/CBot/CBotClass.cpp
@@ -17,21 +17,27 @@
* along with this program. If not, see http://gnu.org/licenses
*/
-/////////////////////////////////////////////////////////////////////
-// Management of variables of class type
-//
-
-#include "CBot.h"
-
-#include "CBotCall.h"
+// Modules inlcude
+#include "CBotClass.h"
#include "CBotInstr/CBotNew.h"
#include "CBotInstr/CBotLeftExprVar.h"
#include "CBotInstr/CBotTwoOpExpr.h"
+#include "CBotCall.h"
+
+// Local include
+
+// Global include
+
+
+////////////////////////////////////////////////////////////////////////////////
CBotClass* CBotClass::m_ExClass = nullptr;
-CBotClass::CBotClass(const char* name, CBotClass* pPapa, bool bIntrinsic)
+////////////////////////////////////////////////////////////////////////////////
+CBotClass::CBotClass(const char* name,
+ CBotClass* pPapa,
+ bool bIntrinsic)
{
m_pParent = pPapa;
m_name = name;
@@ -60,6 +66,7 @@ CBotClass::CBotClass(const char* name, CBotClass* pPapa, bool bIntrinsic)
}
+////////////////////////////////////////////////////////////////////////////////
CBotClass::~CBotClass()
{
// removes the list of class
@@ -77,11 +84,15 @@ CBotClass::~CBotClass()
delete m_next; // releases all of them on this level
}
-CBotClass* CBotClass::Create(const char* name, CBotClass* parent, bool intrinsic)
+////////////////////////////////////////////////////////////////////////////////
+CBotClass* CBotClass::Create(const char* name,
+ CBotClass* parent,
+ bool intrinsic)
{
return new CBotClass(name, parent, intrinsic);
}
+////////////////////////////////////////////////////////////////////////////////
void CBotClass::Free()
{
while ( m_ExClass != nullptr )
@@ -90,6 +101,7 @@ void CBotClass::Free()
}
}
+////////////////////////////////////////////////////////////////////////////////
void CBotClass::Purge()
{
if ( this == nullptr ) return;
@@ -108,6 +120,7 @@ void CBotClass::Purge()
m_next = nullptr; // no longer belongs to this chain
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::Lock(CBotProgram* p)
{
int i = m_cptLock++;
@@ -144,6 +157,7 @@ bool CBotClass::Lock(CBotProgram* p)
return false;
}
+////////////////////////////////////////////////////////////////////////////////
void CBotClass::Unlock()
{
if ( --m_cptOne > 0 ) return ;
@@ -162,6 +176,7 @@ void CBotClass::Unlock()
m_ProgInLock[i] = nullptr;
}
+////////////////////////////////////////////////////////////////////////////////
void CBotClass::FreeLock(CBotProgram* p)
{
CBotClass* pClass = m_ExClass;
@@ -182,9 +197,10 @@ void CBotClass::FreeLock(CBotProgram* p)
}
}
-
-
-bool CBotClass::AddItem(CBotString name, CBotTypResult type, int mPrivate)
+////////////////////////////////////////////////////////////////////////////////
+bool CBotClass::AddItem(CBotString name,
+ CBotTypResult type,
+ int mPrivate)
{
CBotToken token(name, CBotString());
CBotClass* pClass = type.GetClass();
@@ -207,7 +223,7 @@ bool CBotClass::AddItem(CBotString name, CBotTypResult type, int mPrivate)
return AddItem( pVar );
}
-
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::AddItem(CBotVar* pVar)
{
pVar->SetUniqNum(++m_nbVar);
@@ -218,6 +234,7 @@ bool CBotClass::AddItem(CBotVar* pVar)
return true;
}
+////////////////////////////////////////////////////////////////////////////////
void CBotClass::AddNext(CBotClass* pClass)
{
CBotClass* p = this;
@@ -226,17 +243,20 @@ void CBotClass::AddNext(CBotClass* pClass)
p->m_next = pClass;
}
+////////////////////////////////////////////////////////////////////////////////
CBotString CBotClass::GetName()
{
return m_name;
}
+////////////////////////////////////////////////////////////////////////////////
CBotClass* CBotClass::GetParent()
{
if ( this == nullptr ) return nullptr;
return m_pParent;
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::IsChildOf(CBotClass* pClass)
{
CBotClass* p = this;
@@ -248,12 +268,13 @@ bool CBotClass::IsChildOf(CBotClass* pClass)
return false;
}
-
+////////////////////////////////////////////////////////////////////////////////
CBotVar* CBotClass::GetVar()
{
return m_pVar;
}
+////////////////////////////////////////////////////////////////////////////////
CBotVar* CBotClass::GetItem(const char* name)
{
CBotVar* p = m_pVar;
@@ -267,6 +288,7 @@ CBotVar* CBotClass::GetItem(const char* name)
return nullptr;
}
+////////////////////////////////////////////////////////////////////////////////
CBotVar* CBotClass::GetItemRef(int nIdent)
{
CBotVar* p = m_pVar;
@@ -280,16 +302,19 @@ CBotVar* CBotClass::GetItemRef(int nIdent)
return nullptr;
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::IsIntrinsic()
{
return m_bIntrinsic;
}
+////////////////////////////////////////////////////////////////////////////////
CBotClass* CBotClass::Find(CBotToken* &pToken)
{
return Find(pToken->GetString());
}
+////////////////////////////////////////////////////////////////////////////////
CBotClass* CBotClass::Find(const char* name)
{
CBotClass* p = m_ExClass;
@@ -303,9 +328,10 @@ CBotClass* CBotClass::Find(const char* name)
return nullptr;
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::AddFunction(const char* name,
- bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception, void* user),
- CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar))
+ bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception, void* user),
+ CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar))
{
// stores pointers to the two functions
CBotCallMethode* p = m_pCalls;
@@ -332,18 +358,19 @@ bool CBotClass::AddFunction(const char* name,
return true;
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::AddUpdateFunc( void rMaj ( CBotVar* pThis, void* pUser ) )
{
m_rMaj = rMaj;
return true;
}
-// compiles a method associated with an instance of class
-// the method can be declared by the user or AddFunction
-
+////////////////////////////////////////////////////////////////////////////////
CBotTypResult CBotClass::CompileMethode(const char* name,
- CBotVar* pThis, CBotVar** ppParams,
- CBotCStack* pStack, long& nIdent)
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotCStack* pStack,
+ long& nIdent)
{
nIdent = 0; // forget the previous one if necessary
@@ -360,11 +387,13 @@ CBotTypResult CBotClass::CompileMethode(const char* name,
return r;
}
-// executes a method
-
-bool CBotClass::ExecuteMethode(long& nIdent, const char* name,
- CBotVar* pThis, CBotVar** ppParams,
- CBotVar* &pResult, CBotStack* &pStack,
+////////////////////////////////////////////////////////////////////////////////
+bool CBotClass::ExecuteMethode(long& nIdent,
+ const char* name,
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotVar* &pResult,
+ CBotStack* &pStack,
CBotToken* pToken)
{
int ret = m_pCalls->DoCall(nIdent, name, pThis, ppParams, pResult, pStack, pToken);
@@ -382,17 +411,17 @@ bool CBotClass::ExecuteMethode(long& nIdent, const char* name,
return ret;
}
-// restored the execution stack
-
-void CBotClass::RestoreMethode(long& nIdent, const char* name, CBotVar* pThis,
- CBotVar** ppParams, CBotStack* &pStack)
+////////////////////////////////////////////////////////////////////////////////
+void CBotClass::RestoreMethode(long& nIdent,
+ const char* name,
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotStack* &pStack)
{
m_pMethod->RestoreCall(nIdent, name, pThis, ppParams, pStack, this);
}
-
-
-
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::SaveStaticState(FILE* pf)
{
if (!WriteWord( pf, CBOTVERSION*2)) return false;
@@ -429,6 +458,7 @@ bool CBotClass::SaveStaticState(FILE* pf)
return true;
}
+////////////////////////////////////////////////////////////////////////////////
bool CBotClass::RestoreStaticState(FILE* pf)
{
CBotString ClassName, VarName;
@@ -466,9 +496,9 @@ bool CBotClass::RestoreStaticState(FILE* pf)
return true;
}
-// test if a procedure name is already defined somewhere
-
-bool CBotClass::CheckCall(CBotToken* &pToken, CBotDefParam* pParam)
+////////////////////////////////////////////////////////////////////////////////
+bool CBotClass::CheckCall(CBotToken* &pToken,
+ CBotDefParam* pParam)
{
CBotString name = pToken->GetString();
diff --git a/src/CBot/CBotClass.h b/src/CBot/CBotClass.h
new file mode 100644
index 0000000..e2bc000
--- /dev/null
+++ b/src/CBot/CBotClass.h
@@ -0,0 +1,328 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsitec.ch; http://colobot.info; http://github.com/colobot
+ *
+ * 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://gnu.org/licenses
+ */
+
+#pragma once
+
+// Modules inlcude
+#include "CBotDll.h"
+
+// Local include
+
+// Global include
+
+/*!
+ * \brief The CBotClass class Class to define new classes in the language CBOT
+ * for example to define the class CPoint (x, y).
+ */
+class CBotClass
+{
+public:
+ //! Mark if is set or not
+ bool m_IsDef;
+
+ /*!
+ * \brief CBotClass Constructor. Once a class is created, it is known around
+ * CBot intrinsic mode gives a class that is not managed by pointers.
+ * \param name
+ * \param pParent
+ * \param bIntrinsic
+ */
+ CBotClass( const char* name,
+ CBotClass* pParent,
+ bool bIntrinsic = false );
+
+ /*!
+ * \brief CBotClass Destructor.
+ */
+ ~CBotClass( );
+
+ /*!
+ * \brief Create
+ * \param name
+ * \param parent
+ * \param intrinsic
+ * \return
+ */
+ static CBotClass* Create(const char* name,
+ CBotClass* parent,
+ bool intrinsic = false);
+
+ /*!
+ * \brief AddFunction This call allows to add as external (**) new method
+ * used by the objects of this class.
+ * \param name
+ * \param rExec
+ * \param rCompile
+ * \return
+ */
+ bool AddFunction(const char* name,
+ bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception, void* user),
+ CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar));
+
+ /*!
+ * \brief AddUpdateFunc Defines routine to be called to update the elements
+ * of the class.
+ * \param rMaj
+ * \return
+ */
+ bool AddUpdateFunc( void rMaj ( CBotVar* pThis, void* pUser ) );
+ //
+
+ /*!
+ * \brief AddItem Adds an element to the class.
+ * \param name
+ * \param type
+ * \param mPrivate
+ * \return
+ */
+ bool AddItem(CBotString name, CBotTypResult type, int mPrivate = PR_PUBLIC);
+
+ /*!
+ * \brief AddItem Adds an item by passing the pointer to an instance of a
+ * variable the object is taken as is, so do not destroyed.
+ * \param pVar
+ * \return
+ */
+ bool AddItem(CBotVar* pVar);
+
+ /*!
+ * \brief AddNext
+ * \param pClass
+ */
+ void AddNext(CBotClass* pClass);
+
+ /*!
+ * \brief GetName Gives the name of the class.
+ * \return
+ */
+ CBotString GetName();
+
+ /*!
+ * \brief GetParent Gives the parent class (or nullptr).
+ * \return
+ */
+ CBotClass* GetParent();
+
+ /*!
+ * \brief IsChildOf True if a class is derived (Extends) of another.
+ * \param pClass
+ * \return true also if the classes are identical
+ */
+ bool IsChildOf(CBotClass* pClass);
+
+ /*!
+ * \brief Find Trouve une classe d'après son nom
+ * \param pToken
+ * \return A class by it's its name.
+ */
+ static CBotClass* Find(CBotToken* &pToken);
+
+ /*!
+ * \brief Find
+ * \param name
+ * \return
+ */
+ static CBotClass* Find(const char* name);
+
+ /*!
+ * \brief GetVar Return the list of variables.
+ * \return
+ */
+ CBotVar* GetVar();
+ /*!
+ * \brief GetItem One of the variables according to its name.
+ * \param name
+ * \return
+ */
+ CBotVar* GetItem(const char* name);
+
+ /*!
+ * \brief GetItemRef
+ * \param nIdent
+ * \return
+ */
+ CBotVar* GetItemRef(int nIdent);
+
+ /*!
+ * \brief CompileMethode Compiles a method associated with an instance of
+ * class the method can be declared by the user or AddFunction.
+ * \param name
+ * \param pThis
+ * \param ppParams
+ * \param pStack
+ * \param nIdent
+ * \return
+ */
+ CBotTypResult CompileMethode(const char* name,
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotCStack* pStack,
+ long& nIdent);
+
+ /*!
+ * \brief ExecuteMethode Executes a method.
+ * \param nIdent
+ * \param name
+ * \param pThis
+ * \param ppParams
+ * \param pResult
+ * \param pStack
+ * \param pToken
+ * \return
+ */
+ bool ExecuteMethode(long& nIdent,
+ const char* name,
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotVar* &pResult,
+ CBotStack* &pStack,
+ CBotToken* pToken);
+
+ /*!
+ * \brief RestoreMethode Restored the execution stack.
+ * \param nIdent
+ * \param name
+ * \param pThis
+ * \param ppParams
+ * \param pStack
+ */
+ void RestoreMethode(long& nIdent,
+ const char* name,
+ CBotVar* pThis,
+ CBotVar** ppParams,
+ CBotStack* &pStack);
+
+ /*!
+ * \brief Compile Compiles a class declared by the user.
+ * \param p
+ * \param pStack
+ * \return
+ */
+ static CBotClass* Compile(CBotToken* &p,
+ CBotCStack* pStack);
+
+ /*!
+ * \brief Compile1
+ * \param p
+ * \param pStack
+ * \return
+ */
+ static CBotClass* Compile1(CBotToken* &p,
+ CBotCStack* pStack);
+
+ /*!
+ * \brief CompileDefItem
+ * \param p
+ * \param pStack
+ * \param bSecond
+ * \return
+ */
+ bool CompileDefItem(CBotToken* &p,
+ CBotCStack* pStack,
+ bool bSecond);
+
+ /*!
+ * \brief IsIntrinsic
+ * \return
+ */
+ bool IsIntrinsic();
+
+ /*!
+ * \brief Purge
+ */
+ void Purge();
+
+ /*!
+ * \brief Free
+ */
+ static void Free();
+
+ /*!
+ * \brief SaveStaticState
+ * \param pf
+ * \return
+ */
+ static bool SaveStaticState(FILE* pf);
+
+ /*!
+ * \brief RestoreStaticState
+ * \param pf
+ * \return
+ */
+ static bool RestoreStaticState(FILE* pf);
+
+ /*!
+ * \brief Lock
+ * \param p
+ * \return
+ */
+ bool Lock(CBotProgram* p);
+
+ /*!
+ * \brief Unlock
+ */
+ void Unlock();
+
+ /*!
+ * \brief FreeLock
+ * \param p
+ */
+ static void FreeLock(CBotProgram* p);
+
+ /*!
+ * \brief CheckCall Test if a procedure name is already defined somewhere.
+ * \param pToken
+ * \param pParam
+ * \return
+ */
+ bool CheckCall(CBotToken* &pToken,
+ CBotDefParam* pParam);
+
+private:
+ //! List of classes existing at a given time.
+ static CBotClass* m_ExClass;
+ //! For this general list.
+ CBotClass* m_ExNext;
+ //! For this general list.
+ CBotClass* m_ExPrev;
+ //! Parent class.
+ CBotClass* m_pParent;
+ //! Name of this class.
+ CBotString m_name;
+ //! Number of variables in the chain.
+ int m_nbVar;
+ //! Content of the class.
+ CBotVar* m_pVar;
+ //! Intrinsic class.
+ bool m_bIntrinsic;
+ //! The string class.
+ CBotClass* m_next;
+ //! List of methods defined in external.
+ CBotCallMethode* m_pCalls;
+ //! Compiled list of methods.
+ CBotFunction* m_pMethod;
+ void (*m_rMaj) ( CBotVar* pThis, void* pUser );
+ friend class CBotVarClass;
+ //! For Lock / UnLock.
+ int m_cptLock;
+ //! Lock for reentrancy.
+ int m_cptOne;
+ //! Processes waiting for sync.
+ CBotProgram* m_ProgInLock[5];
+};
diff --git a/src/CBot/CBotDll.h b/src/CBot/CBotDll.h
index deec62c..c1e8b69 100644
--- a/src/CBot/CBotDll.h
+++ b/src/CBot/CBotDll.h
@@ -847,124 +847,6 @@ virtual ~CBotVar( ); // destructor
*/
-
-////////////////////////////////////////////////////////////////////////
-// management of classes
-////////////////////////////////////////////////////////////////////////
-
-// class to define new classes in the language CBOT
-// for example to define the class CPoint (x, y)
-
-class CBotClass
-{
-private:
- static
- CBotClass* m_ExClass; // list of classes existing at a given time
- CBotClass* m_ExNext; // for this general list
- CBotClass* m_ExPrev; // for this general list
-
-private:
- CBotClass* m_pParent; // parent class
- CBotString m_name; // name of this class
- int m_nbVar; // number of variables in the chain
- CBotVar* m_pVar; // content of the class
- bool m_bIntrinsic; // intrinsic class
- CBotClass* m_next; // the string class
- CBotCallMethode* m_pCalls; // list of methods defined in external
- CBotFunction* m_pMethod; // compiled list of methods
- void (*m_rMaj) ( CBotVar* pThis, void* pUser );
- friend class CBotVarClass;
- int m_cptLock; // for Lock / UnLock
- int m_cptOne; // Lock for reentrancy
- CBotProgram* m_ProgInLock[5];// processes waiting for sync
-
-public:
- bool m_IsDef; // mark if is set or not
-
- CBotClass( const char* name,
- CBotClass* pParent, bool bIntrinsic = false ); // constructor
- // Once a class is created, it is known
- // around CBoT
- // intrinsic mode gives a class that is not managed by pointers
-
- ~CBotClass( ); // destructor
-
- static CBotClass* Create(const char* name, CBotClass* parent, bool intrinsic = false);
-
- bool AddFunction(const char* name,
- bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception, void* user),
- CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar));
- // this call allows to add as external (**)
- // new method used by the objects of this class
-
- bool AddUpdateFunc( void rMaj ( CBotVar* pThis, void* pUser ) );
- // defines routine to be called to update the elements of the class
-
- bool AddItem(CBotString name, CBotTypResult type, int mPrivate = PR_PUBLIC);
- // adds an element to the class
-// bool AddItem(CBotString name, CBotClass* pClass);
- // the same for elements belonging to pClass
- bool AddItem(CBotVar* pVar);
- // adds an item by passing the pointer to an instance of a variable
- // the object is taken as is, so do not destroyed
-
-
-
- // adds an element by giving an element of type CBotVar
- void AddNext(CBotClass* pClass);
-
- CBotString GetName(); // gives the name of the class
- CBotClass* GetParent(); // gives the parent class (or nullptr)
-
- // true if a class is derived (Extends) of another
- // return true also if the classes are identical
- bool IsChildOf(CBotClass* pClass);
-
- static
- CBotClass* Find(CBotToken* &pToken); // trouve une classe d'après son nom
- // return a class by it's its name
- static
- CBotClass* Find(const char* name);
-
- 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);
-
- bool ExecuteMethode(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppParams, CBotVar* &pResult, CBotStack* &pStack, CBotToken* pToken);
- void RestoreMethode(long& nIdent, const char* name, CBotVar* pThis, CBotVar** ppParams, CBotStack* &pStack);
-
- // compiles a class declared by the user
- static
- CBotClass* Compile(CBotToken* &p, CBotCStack* pStack);
- static
- CBotClass* Compile1(CBotToken* &p, CBotCStack* pStack);
-
- bool CompileDefItem(CBotToken* &p, CBotCStack* pStack, bool bSecond);
-
- bool IsIntrinsic();
- void Purge();
- static
- void Free();
-
- static
- bool SaveStaticState(FILE* pf);
-
- static
- bool RestoreStaticState(FILE* pf);
-
- bool Lock(CBotProgram* p);
- void Unlock();
- static
- void FreeLock(CBotProgram* p);
-
- bool CheckCall(CBotToken* &pToken, CBotDefParam* pParam);
-
-};
-
-
/*
////////////////////////////////////////////////////////////////////////
// Examples of use
diff --git a/src/CBot/CBotFunction.cpp b/src/CBot/CBotFunction.cpp
index 64b85fd..61a9887 100644
--- a/src/CBot/CBotFunction.cpp
+++ b/src/CBot/CBotFunction.cpp
@@ -30,6 +30,7 @@
#include "CBotInstr/CBotListArray.h"
#include "CBotStack.h"
+#include "CBotClass.h"
#include <cassert>
diff --git a/src/CBot/CBotInstr/CBotClassInst.cpp b/src/CBot/CBotInstr/CBotClassInst.cpp
index e02328d..a78b4de 100644
--- a/src/CBot/CBotInstr/CBotClassInst.cpp
+++ b/src/CBot/CBotInstr/CBotClassInst.cpp
@@ -24,6 +24,7 @@
#include "CBotInstArray.h"
#include "CBotStack.h"
+#include "CBotClass.h"
// Local include
diff --git a/src/CBot/CBotInstr/CBotFieldExpr.cpp b/src/CBot/CBotInstr/CBotFieldExpr.cpp
index ae8e583..592d4a7 100644
--- a/src/CBot/CBotInstr/CBotFieldExpr.cpp
+++ b/src/CBot/CBotInstr/CBotFieldExpr.cpp
@@ -21,6 +21,7 @@
#include "CBotFieldExpr.h"
#include "CBotStack.h"
+#include "CBotClass.h"
// Local include
diff --git a/src/CBot/CBotInstr/CBotInstrMethode.cpp b/src/CBot/CBotInstr/CBotInstrMethode.cpp
index 1ec9906..a33207f 100644
--- a/src/CBot/CBotInstr/CBotInstrMethode.cpp
+++ b/src/CBot/CBotInstr/CBotInstrMethode.cpp
@@ -21,6 +21,7 @@
#include "CBotInstrMethode.h"
#include "CBotStack.h"
+#include "CBotClass.h"
// Local include
diff --git a/src/CBot/CBotInstr/CBotLeftExpr.cpp b/src/CBot/CBotInstr/CBotLeftExpr.cpp
index 0785dd2..468854a 100644
--- a/src/CBot/CBotInstr/CBotLeftExpr.cpp
+++ b/src/CBot/CBotInstr/CBotLeftExpr.cpp
@@ -24,6 +24,7 @@
#include "CBotExpression.h"
#include "CBotStack.h"
+#include "CBotClass.h"
#include "CBotVar/CBotVarArray.h"
diff --git a/src/CBot/CBotInstr/CBotNew.cpp b/src/CBot/CBotInstr/CBotNew.cpp
index fef5c07..9da2a88 100644
--- a/src/CBot/CBotInstr/CBotNew.cpp
+++ b/src/CBot/CBotInstr/CBotNew.cpp
@@ -21,6 +21,7 @@
#include "CBotNew.h"
#include "CBotStack.h"
+#include "CBotClass.h"
// Local include
diff --git a/src/CBot/CBotProgram.cpp b/src/CBot/CBotProgram.cpp
index a20531e..27485f8 100644
--- a/src/CBot/CBotProgram.cpp
+++ b/src/CBot/CBotProgram.cpp
@@ -24,7 +24,7 @@
#include "CBotCall.h"
#include "CBotStack.h"
-
+#include "CBotClass.h"
#include "CBotUtils.h"
#include <stdio.h>
diff --git a/src/CBot/CBotVar.cpp b/src/CBot/CBotVar.cpp
index 490af3f..8808cb0 100644
--- a/src/CBot/CBotVar.cpp
+++ b/src/CBot/CBotVar.cpp
@@ -30,6 +30,7 @@
#include "CBotVar/CBotVarArray.h"
#include "CBotDefines.h"
+#include "CBotClass.h"
#include <cassert>
#include <cmath>
diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 483f080..8ff82ee 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -20,6 +20,8 @@
#include "level/robotmain.h"
#include "CBot/CBotDll.h"
+// TODO must be replaced by CBot.h
+#include "CBot/CBotClass.h"
#include "app/app.h"
#include "app/input.h"
diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp
index a49dc9c..7ff6171 100644
--- a/src/script/scriptfunc.cpp
+++ b/src/script/scriptfunc.cpp
@@ -19,6 +19,9 @@
#include "script/scriptfunc.h"
+// TODO must be replaced by CBot.h
+#include "CBot/CBotClass.h"
+
#include "app/app.h"
#include "common/global.h"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list