Colobot
Loading...
Searching...
No Matches
CBot::CBotExternalCallClass Class Reference

Implementation of CBot external call for class methods, using compilation and runtime functions. More...

#include <src/CBot/CBotExternalCall.h>

Inheritance diagram for CBot::CBotExternalCallClass:

Public Types

typedef bool(* RuntimeFunc) (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
typedef CBotTypResult(* CompileFunc) (CBotVar *pThis, CBotVar *&pVar)

Public Member Functions

 CBotExternalCallClass (RuntimeFunc rExec, CompileFunc rCompile)
 Constructor.
virtual ~CBotExternalCallClass ()
 Destructor.
virtual CBotTypResult Compile (CBotVar *thisVar, CBotVar *args, void *user) override
 Compile the function.
virtual bool Run (CBotVar *thisVar, CBotStack *pStack) override
 Execute the function.
Public Member Functions inherited from CBot::CBotExternalCall
 CBotExternalCall ()
 Constructor.
virtual ~CBotExternalCall ()
 Destructor.

Detailed Description

Implementation of CBot external call for class methods, using compilation and runtime functions.

Constructor & Destructor Documentation

◆ CBotExternalCallClass()

CBot::CBotExternalCallClass::CBotExternalCallClass ( RuntimeFunc rExec,
CompileFunc rCompile )

Constructor.

Parameters
rExecRuntime function
rCompileCompilation function
See also
CBotProgram::AddFunction()

◆ ~CBotExternalCallClass()

CBot::CBotExternalCallClass::~CBotExternalCallClass ( )
virtual

Destructor.

Member Function Documentation

◆ Compile()

CBotTypResult CBot::CBotExternalCallClass::Compile ( CBotVar * thisVar,
CBotVar * args,
void * user )
overridevirtual

Compile the function.

Parameters
thisVar"this" variable for class calls, nullptr for normal calls
argsArguments (only types!) passed to the function
userUser pointer provided to CBotProgram::Compile()

Implements CBot::CBotExternalCall.

◆ Run()

bool CBot::CBotExternalCallClass::Run ( CBotVar * thisVar,
CBotStack * pStack )
overridevirtual

Execute the function.

Parameters
thisVar"this" variable for class calls, nullptr for normal calls
pStackStack to execute the function on
Returns
false to request program interruption, true otherwise

Implements CBot::CBotExternalCall.


The documentation for this class was generated from the following files: