Class to define the complete type of a variable.
More...
#include <src/CBot/CBotTypResult.h>
|
| | CBotTypResult (int type) |
| | Constructor for simple types (::CBotTypInt to ::CBotTypString).
|
| | CBotTypResult (int type, const std::string &name) |
| | Constructor for pointer types and intrinsic classes.
|
| | CBotTypResult (int type, CBotClass *pClass) |
| | Constructor for instance of a class.
|
| | CBotTypResult (int type, CBotTypResult elem) |
| | Constructor for arrays.
|
| | CBotTypResult (const CBotTypResult &typ) |
| | Copy constructor.
|
| | CBotTypResult () |
| | Default constructor.
|
| | ~CBotTypResult () |
| | Destructor.
|
| int | GetType (GetTypeMode mode=GetTypeMode::NORMAL) const |
| | Returns ::CBotType or ::CBotError stored in this object.
|
| void | SetType (int n) |
| | Changes ::CBotType or ::CBotError stored in this object.
|
| CBotClass * | GetClass () const |
| | Returns CBotClass pointer (for ::CBotTypClass, ::CBotTypPointer).
|
| int | GetLimite () const |
| | Get size limit of an array (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
|
| void | SetLimite (int n) |
| | Set size limit of an array (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
|
| void | SetArray (int max[]) |
| | Set size limit of an multidimensional array.
|
| CBotTypResult & | GetTypElem () const |
| | Get type of array elements (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
|
| bool | Compare (const CBotTypResult &typ) const |
| | Compares whether the types are compatible.
|
| bool | Eq (int type) const |
| | Compare type only.
|
| CBotTypResult & | operator= (const CBotTypResult &src) |
| | Copy.
|
| std::string | ToString () |
| | Get this type name as string.
|
|
|
class | CBotVarClass |
|
class | CBotVarPointer |
Class to define the complete type of a variable.
Examples:
CBotTypResult()
Default constructor.
Definition CBotTypResult.cpp:89
@ CBotTypIntrinsic
Intrinsic class instance.
Definition CBotEnums.h:54
@ CBotTypString
string
Definition CBotEnums.h:46
@ CBotTypFloat
float
Definition CBotEnums.h:43
@ CBotTypArrayPointer
Pointer to an array (CBotTypArrayBody).
Definition CBotEnums.h:48
◆ GetTypeMode
◆ CBotTypResult() [1/6]
| CBot::CBotTypResult::CBotTypResult |
( |
int | type | ) |
|
Constructor for simple types (::CBotTypInt to ::CBotTypString).
- Parameters
-
| type | type of created result, see ::CBotType. This can also sometimes be a value from ::CBotError. |
◆ CBotTypResult() [2/6]
| CBot::CBotTypResult::CBotTypResult |
( |
int | type, |
|
|
const std::string & | name ) |
Constructor for pointer types and intrinsic classes.
This is equivalent to calling:
static CBotClass * Find(CBotToken *&pToken)
Find Trouve une classe d'après son nom.
Definition CBotClass.cpp:271
- Parameters
-
| type | type of created result, see ::CBotType |
| name | name of the class |
◆ CBotTypResult() [3/6]
| CBot::CBotTypResult::CBotTypResult |
( |
int | type, |
|
|
CBotClass * | pClass ) |
Constructor for instance of a class.
- Parameters
-
| type | type of created result, see ::CBotType |
| pClass | class type |
◆ CBotTypResult() [4/6]
| CBot::CBotTypResult::CBotTypResult |
( |
int | type, |
|
|
CBotTypResult | elem ) |
Constructor for arrays.
- Parameters
-
| type | type of created result, see ::CBotType |
| elem | type of array elements |
◆ CBotTypResult() [5/6]
| CBot::CBotTypResult::CBotTypResult |
( |
const CBotTypResult & | typ | ) |
|
◆ CBotTypResult() [6/6]
| CBot::CBotTypResult::CBotTypResult |
( |
| ) |
|
◆ ~CBotTypResult()
| CBot::CBotTypResult::~CBotTypResult |
( |
| ) |
|
◆ GetType()
| int CBot::CBotTypResult::GetType |
( |
GetTypeMode | mode = GetTypeMode::NORMAL | ) |
const |
Returns ::CBotType or ::CBotError stored in this object.
- Parameters
-
◆ SetType()
| void CBot::CBotTypResult::SetType |
( |
int | n | ) |
|
Changes ::CBotType or ::CBotError stored in this object.
- Parameters
-
◆ GetClass()
| CBotClass * CBot::CBotTypResult::GetClass |
( |
| ) |
const |
Returns CBotClass pointer (for ::CBotTypClass, ::CBotTypPointer).
◆ GetLimite()
| int CBot::CBotTypResult::GetLimite |
( |
| ) |
const |
Get size limit of an array (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
◆ SetLimite()
| void CBot::CBotTypResult::SetLimite |
( |
int | n | ) |
|
Set size limit of an array (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
- Parameters
-
◆ SetArray()
| void CBot::CBotTypResult::SetArray |
( |
int | max[] | ) |
|
Set size limit of an multidimensional array.
- Parameters
-
| max | Array of limit values, the array size has to match the number of dimensions of this array |
◆ GetTypElem()
Get type of array elements (for ::CBotTypArrayBody or ::CBotTypArrayPointer).
◆ Compare()
| bool CBot::CBotTypResult::Compare |
( |
const CBotTypResult & | typ | ) |
const |
Compares whether the types are compatible.
This compares the whole object with another
◆ Eq()
| bool CBot::CBotTypResult::Eq |
( |
int | type | ) |
const |
Compare type only.
This compares the general "type" part of this object, without checking the additional parameters
◆ operator=()
◆ ToString()
| std::string CBot::CBotTypResult::ToString |
( |
| ) |
|
Get this type name as string.
- Returns
- This type name as string
The documentation for this class was generated from the following files:
- src/CBot/CBotTypResult.h
- src/CBot/CBotTypResult.cpp