22 #include "CBot/CBotDefines.h" 23 #include "CBot/CBotTypResult.h" 24 #include "CBot/CBotVar/CBotVar.h" 33 class CBotCallMethode;
117 bool bIntrinsic =
false);
133 bool intrinsic =
false);
255 const std::string& name,
271 const std::string& name,
363 void Update(
CBotVar* var,
void* user);
367 static std::set<CBotClass*> m_publicClasses;
386 void (*m_rUpdate)(
CBotVar* thisVar,
void* user);
389 int m_lockCurrentCount = 0;
391 std::deque<CBotProgram*> m_lockProg{};
The CBotCallMethode class Class managing the methods declared by AddFunction on a class...
Definition: CBotCallMethode.h:37
A function declaration in the code.
Definition: CBotFunction.h:42
static CBotClass * Compile(CBotToken *&p, CBotCStack *pStack)
Compile Compiles a class declared by the user.
Definition: CBotClass.cpp:768
The CBotDefParam class A list of parameters.
Definition: CBotDefParam.h:36
bool ExecuteMethode(long &nIdent, const std::string &name, CBotVar *pThis, CBotVar **ppParams, CBotVar *&pResult, CBotStack *&pStack, CBotToken *pToken)
ExecuteMethode Executes a method.
Definition: CBotClass.cpp:341
CBotClass(const std::string &name, CBotClass *parent, bool bIntrinsic=false)
CBotClass Constructor. Once a class is created, it is known around CBot intrinsic mode gives a class ...
Definition: CBotClass.cpp:51
Class that manages a CBot program. This is the main entry point into the CBot engine.
Definition: CBotProgram.h:83
std::string GetName()
GetName Gives the name of the class.
Definition: CBotClass.cpp:200
CBotVar * GetItem(const std::string &name)
GetItem One of the variables according to its name.
Definition: CBotClass.cpp:231
The execution stack.
Definition: CBotStack.h:44
bool IsChildOf(CBotClass *pClass)
IsChildOf True if a class is derived (Extends) of another.
Definition: CBotClass.cpp:213
void Purge()
Purge.
Definition: CBotClass.cpp:93
bool CheckCall(CBotProgram *program, CBotDefParam *pParam, CBotToken *&pToken)
CheckCall Test if a procedure name is already defined somewhere.
Definition: CBotClass.cpp:447
A CBot class definition.
Definition: CBotClass.h:105
static bool RestoreStaticState(FILE *pf)
RestoreStaticState.
Definition: CBotClass.cpp:409
bool IsIntrinsic()
IsIntrinsic.
Definition: CBotClass.cpp:259
bool AddItem(std::string name, CBotTypResult type, CBotVar::ProtectionLevel mPrivate=CBotVar::ProtectionLevel::Public)
AddItem Adds an element to the class.
Definition: CBotClass.cpp:164
A CBot variable.
Definition: CBotVar.h:42
bool SetUpdateFunc(void rUpdate(CBotVar *thisVar, void *user))
SetUpdateFunc Defines routine to be called to update the elements of the class.
Definition: CBotClass.cpp:312
ProtectionLevel
Class member protection level (public/protected/private)
Definition: CBotVar.h:306
The CBotCStack class Management of the stack of compilation.
Definition: CBotCStack.h:35
static void ClearPublic()
Free.
Definition: CBotClass.cpp:87
~CBotClass()
CBotClass Destructor.
Definition: CBotClass.cpp:69
static CBotClass * Compile1(CBotToken *&p, CBotCStack *pStack)
Compile1.
Definition: CBotClass.cpp:469
bool CompileDefItem(CBotToken *&p, CBotCStack *pStack, bool bSecond)
CompileDefItem.
Definition: CBotClass.cpp:525
CBotClass * GetParent()
GetParent Gives the parent class (or nullptr).
Definition: CBotClass.cpp:206
void RestoreMethode(long &nIdent, const std::string &name, CBotVar *pThis, CBotVar **ppParams, CBotStack *&pStack)
RestoreMethode Restored the execution stack.
Definition: CBotClass.cpp:365
bool AddFunction(const std::string &name, bool rExec(CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user), CBotTypResult rCompile(CBotVar *pThis, CBotVar *&pVar))
AddFunction This call allows to add as external new method used by the objects of this class...
Definition: CBotClass.cpp:282
static CBotClass * Create(const std::string &name, CBotClass *parent, bool intrinsic=false)
Create.
Definition: CBotClass.cpp:79
CBotVar * GetVar()
GetVar Return the list of variables.
Definition: CBotClass.cpp:225
bool Lock(CBotProgram *prog)
Request a lock on this class (for "synchronized" keyword)
Definition: CBotClass.cpp:112
CBotTypResult CompileMethode(const std::string &name, CBotVar *pThis, CBotVar **ppParams, CBotCStack *pStack, long &nIdent)
CompileMethode Compiles a method associated with an instance of class the method can be declared by t...
Definition: CBotClass.cpp:319
Definition: CBotUtils.h:99
CBotVar * GetItemRef(int nIdent)
GetItemRef.
Definition: CBotClass.cpp:245
static bool SaveStaticState(FILE *pf)
SaveStaticState.
Definition: CBotClass.cpp:375
static void FreeLock(CBotProgram *prog)
Release all locks in all classes held by this program.
Definition: CBotClass.cpp:145
Class to define the complete type of a variable.
Definition: CBotTypResult.h:47
CBot engine.
Definition: CBotCallMethode.cpp:28
Class representing one token of a program.
Definition: CBotToken.h:80
void Unlock()
Release the lock acquired in Lock() If you call Lock() multiple times for the same program...
Definition: CBotClass.cpp:137
static CBotClass * Find(CBotToken *&pToken)
Find Trouve une classe d'après son nom.
Definition: CBotClass.cpp:265