|
Colobot
|
CBotVar subclass for managing double values (CBotTypDouble) More...
#include <src/CBot/CBotVar/CBotVarDouble.h>

Public Member Functions | |
| CBotVarDouble (const CBotToken &name) | |
| bool | Save1State (std::ostream &ostr) override |
| Save variable data. More... | |
Public Member Functions inherited from CBot::CBotVarNumber< double, CBotTypDouble > | |
| CBotVarNumber (const CBotToken &name) | |
| void | Mul (CBotVar *left, CBotVar *right) override |
| Multiplication. More... | |
| void | Power (CBotVar *left, CBotVar *right) override |
| Power. More... | |
| CBotError | Div (CBotVar *left, CBotVar *right) override |
| Division. More... | |
| CBotError | Modulo (CBotVar *left, CBotVar *right) override |
| Modulo (remainder of division) More... | |
| void | Add (CBotVar *left, CBotVar *right) override |
| Addition. More... | |
| void | Sub (CBotVar *left, CBotVar *right) override |
| Subtraction. More... | |
| void | Neg () override |
| -this More... | |
| void | Inc () override |
| ++this More... | |
| void | Dec () override |
| –this More... | |
| bool | Lo (CBotVar *left, CBotVar *right) override |
| left < right More... | |
| bool | Hi (CBotVar *left, CBotVar *right) override |
| left > right More... | |
| bool | Ls (CBotVar *left, CBotVar *right) override |
| left <= right More... | |
| bool | Hs (CBotVar *left, CBotVar *right) override |
| left >= right More... | |
Public Member Functions inherited from CBot::CBotVarNumberBase< T, type > | |
| CBotVarNumberBase (const CBotToken &name) | |
| void | SetValByte (signed char val) override |
| Set the value. More... | |
| void | SetValShort (short val) override |
| Set the value. More... | |
| void | SetValChar (uint32_t val) override |
| Set the value. More... | |
| void | SetValInt (int val, const std::string &s="") override |
| Set value as an integer. More... | |
| void | SetValLong (long val) override |
| Set the value. More... | |
| void | SetValFloat (float val) override |
| Set value as float. More... | |
| void | SetValDouble (double val) override |
| Set the value. More... | |
| signed char | GetValByte () override |
| Set the value. More... | |
| short | GetValShort () override |
| Set the value. More... | |
| uint32_t | GetValChar () override |
| Set the value. More... | |
| int | GetValInt () override |
| Get value as integer. More... | |
| long | GetValLong () override |
| Set the value. More... | |
| float | GetValFloat () override |
| Get value as float. More... | |
| double | GetValDouble () override |
| Set the value. More... | |
| bool | Eq (CBotVar *left, CBotVar *right) override |
| left == right More... | |
| bool | Ne (CBotVar *left, CBotVar *right) override |
| left != right More... | |
Public Member Functions inherited from CBot::CBotVarValue< T, type > | |
| CBotVarValue (const CBotToken &name) | |
| Constructor. Do not call directly, use CBotVar::Create() More... | |
| void | Copy (CBotVar *pSrc, bool bName=true) override |
| Copy from another variable. More... | |
| void | SetValString (const std::string &val) override |
| Set value as string. More... | |
| std::string | GetValString () override |
| Get value as string. More... | |
Public Member Functions inherited from CBot::CBotVar | |
| const std::string & | GetName () |
| Returns the name of the variable. More... | |
| void | SetName (const std::string &name) |
| SetName Changes the name of the variable. More... | |
| CBotToken * | GetToken () |
| Returns the CBotToken this variable is associated with. More... | |
| CBotType | GetType (GetTypeMode mode=GetTypeMode::NORMAL) |
| GetType Returns the base type of the variable (CBotType) More... | |
| CBotTypResult | GetTypResult (GetTypeMode mode=GetTypeMode::NORMAL) |
| Returns the complete type of the variable (CBotTypResult) More... | |
| void | SetType (CBotTypResult &type) |
| Change type of this variable. More... | |
| virtual void | SetClass (CBotClass *pClass) |
| Set class this variable is instance of. More... | |
| virtual CBotClass * | GetClass () |
| Return class this variable is instance of. More... | |
| void | SetInit (InitType initType) |
| Changes variable init status. More... | |
| InitType | GetInit () const |
| Returns the current init state of the variable. More... | |
| bool | IsUndefined () const |
| Checks if the variable is currently "undefined". More... | |
| bool | IsDefined () const |
| Checks if the variable is currently "defined". More... | |
| bool | IsNAN () const |
| Checks if the variable is currently NAN. More... | |
| void | SetStatic (bool bStatic) |
| Marks the variable as "static". More... | |
| bool | IsStatic () |
| Checks if the variable is static. More... | |
| void | SetPrivate (ProtectionLevel mPrivate) |
| Sets variable protection level. More... | |
| bool | IsPrivate (ProtectionLevel level=ProtectionLevel::Protected) |
| Checks if the variable is accessible at the given protection level. More... | |
| ProtectionLevel | GetPrivate () |
| Get variable protection level. More... | |
| bool | IsElemOfClass (const std::string &name) |
| Check if a variable belongs to a class with a given name. More... | |
| virtual void | ConstructorSet () |
| Called after constructor has been called. More... | |
| CBotVar * | GetStaticVar () |
| If this is a static class variable, return the static var from the class. More... | |
| virtual void | Update (void *pUser) |
| Call the class update function. More... | |
| void | SetUniqNum (long n) |
| Set unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem. More... | |
| long | GetUniqNum () |
| Return unique identifier of this variable Note: For classes, this is unique within the class only - see CBotClass:AddItem. More... | |
| virtual bool | Save0State (std::ostream &ostr) |
| Save common variable header (name, type, etc.) More... | |
| CBotVar () | |
| Constructor. Do not call directly, use CBotVar::Create() More... | |
| CBotVar (const CBotToken &name) | |
| Constructor. Do not call directly, use CBotVar::Create() More... | |
| virtual | ~CBotVar () |
| Destructor. Do not call directly, use CBotVar::Destroy() More... | |
| virtual void | SetIdent (long UniqId) |
| Associates an unique identifier to class instance. More... | |
| void | SetUserPtr (void *pUser) |
| Set a custom pointer associated with this variable. More... | |
| void * | GetUserPtr () |
| Returns the custom pointer associated with this variable. More... | |
| virtual CBotVar * | GetItem (const std::string &name) |
| Returns class member by name. More... | |
| virtual CBotVar * | GetItemRef (int nIdent) |
| Returns class member by unique ID. More... | |
| virtual CBotVar * | GetItem (int index, bool grow=false) |
| Returns element of the array by index. More... | |
| virtual CBotVar * | GetItemList () |
| Return all elements of this variable as a linked list. Works for both classes and arrays. More... | |
| operator bool () | |
| Set the value. More... | |
| operator signed char () | |
| Set the value. More... | |
| operator short () | |
| Set the value. More... | |
| operator uint32_t () | |
| Set the value. More... | |
| operator int () | |
| Set the value. More... | |
| operator long () | |
| Set the value. More... | |
| operator float () | |
| Set the value. More... | |
| operator double () | |
| Set the value. More... | |
| operator std::string () | |
| Set the value. More... | |
| void | operator= (const CBotVar &var) |
| Set the value. More... | |
| void | operator= (signed char x) |
| Set the value. More... | |
| void | operator= (short x) |
| Set the value. More... | |
| void | operator= (uint32_t x) |
| Set the value. More... | |
| void | operator= (int x) |
| Set the value. More... | |
| void | operator= (long x) |
| Set the value. More... | |
| void | operator= (float x) |
| Set the value. More... | |
| void | operator= (double x) |
| Set the value. More... | |
| void | operator= (const std::string &x) |
| Set the value. More... | |
| void | SetVal (CBotVar *var) |
| Set the value. More... | |
| virtual void | SetPointer (CBotVar *p) |
| Set value for pointer types. More... | |
| virtual CBotVarClass * | GetPointer () |
| Get value for pointer types. More... | |
| virtual void | And (CBotVar *left, CBotVar *right) |
| left && right or left & right More... | |
| virtual void | Or (CBotVar *left, CBotVar *right) |
| left || right or left | right More... | |
| virtual void | XOr (CBotVar *left, CBotVar *right) |
| left ^ right (also for boolean!) More... | |
| virtual void | Not () |
| !this or ~this More... | |
| virtual void | ASR (CBotVar *left, CBotVar *right) |
| left >> right More... | |
| virtual void | SR (CBotVar *left, CBotVar *right) |
| left >>> right More... | |
| virtual void | SL (CBotVar *left, CBotVar *right) |
| left << right More... | |
Public Member Functions inherited from CBot::CBotLinkedList< CBotVar > | |
| virtual | ~CBotLinkedList () |
| Destructor. Be careful, destroys the whole linked list! More... | |
| CBotVar * | GetNext () |
| Returns the next variable in the linked list. More... | |
| void | AddNext (CBotVar *elem) |
| Appends a new element at the end of the linked list. More... | |
Additional Inherited Members | |
Public Types inherited from CBot::CBotVar | |
| enum class | GetTypeMode { NORMAL = 0 , CLASS_AS_POINTER = 1 , CLASS_AS_INTRINSIC = 2 } |
| Mode for GetType() and GetTypResult() More... | |
| enum class | InitType : int { UNDEF = 0 , DEF = 1 , IS_POINTER = 2 , IS_NAN = 999 } |
| Variable initialization status. More... | |
| enum class | ProtectionLevel { Public = 0 , ReadOnly = 1 , Protected = 2 , Private = 3 } |
| Class member protection level (public/protected/private) More... | |
Static Public Member Functions inherited from CBot::CBotVar | |
| static long | NextUniqNum () |
| Generate next unique identifier. More... | |
| static bool | RestoreState (std::istream &istr, CBotVar *&pVar) |
| Restore variable. More... | |
| static CBotVar * | Create (const std::string &name, CBotTypResult type) |
| Creates a new variable from a type described by CBotTypResult. More... | |
| static CBotVar * | Create (const std::string &name, CBotClass *pClass) |
| Creates a new variable of a given class type. More... | |
| static CBotVar * | Create (const CBotToken &name, CBotType type) |
| Creates a new variable of a given type. More... | |
| static CBotVar * | Create (const CBotToken &name, CBotTypResult type) |
| Create a new variable of a given type described by CBotTypResult. More... | |
| static CBotVar * | Create (const std::string &name, CBotType type, CBotClass *pClass) |
| Create a new variable of a given type of given class instance. More... | |
| static CBotVar * | Create (CBotVar *pVar) |
| Create a new variable of the same type and name as another one. More... | |
| static void | Destroy (CBotVar *var) |
| Destroy a variable. More... | |
Protected Member Functions inherited from CBot::CBotVarValue< T, type > | |
| virtual void | SetValue (T val) |
Protected Attributes inherited from CBot::CBotVarValue< T, type > | |
| T | m_val |
| The value. More... | |
Protected Attributes inherited from CBot::CBotVar | |
| CBotToken *const | m_token |
| The corresponding token, defines the variable name. More... | |
| CBotTypResult | m_type |
| Type of value. More... | |
| InitType | m_binit |
| Initialization status. More... | |
| CBotVarClass * | m_pMyThis |
| Corresponding this element (TODO: ?) More... | |
| void * | m_pUserPtr |
| User pointer if specified. More... | |
| bool | m_bStatic |
| true if the variable is static (for classes) More... | |
| ProtectionLevel | m_mPrivate |
| Element protection level - public, protected or private (for classes) More... | |
| CBotInstr * | m_InitExpr |
| Expression describing initial value. More... | |
| CBotInstr * | m_LimExpr |
| Expression describing array limit. More... | |
| long | m_ident |
| Identifier. More... | |
Protected Attributes inherited from CBot::CBotLinkedList< CBotVar > | |
| CBotVar * | m_next |
Static Protected Attributes inherited from CBot::CBotVar | |
| static long | m_identcpt = 0 |
| TODO: ? More... | |
CBotVar subclass for managing double values (CBotTypDouble)
|
inlineoverridevirtual |
Save variable data.
Overriden in child classes
| ostr | Output stream |
Reimplemented from CBot::CBotVar.