Documentation for CBotVar and all subclasses
parent
2519825104
commit
33ac246297
|
@ -554,7 +554,7 @@ INLINE_INFO = YES
|
|||
# name. If set to NO, the members will appear in declaration order.
|
||||
# The default value is: YES.
|
||||
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
|
||||
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
|
||||
# descriptions of file, namespace and class members alphabetically by member
|
||||
|
|
|
@ -122,12 +122,12 @@ public:
|
|||
bool Compile(const std::string& program, std::vector<std::string>& functions, void* pUser = nullptr);
|
||||
|
||||
/**
|
||||
* \brief Associates an identifier with this instance of CBotProgram
|
||||
* \brief Associates an unique identifier with this instance of CBotProgram
|
||||
*/
|
||||
void SetIdent(long n);
|
||||
|
||||
/**
|
||||
* \brief Returns the identifier
|
||||
* \brief Returns the unique identifier
|
||||
* \see SetIdent
|
||||
*/
|
||||
long GetIdent();
|
||||
|
|
|
@ -126,7 +126,6 @@ public:
|
|||
|
||||
/**
|
||||
* \brief Get type of array elements (for ::CBotTypArrayBody or ::CBotTypArrayPointer)
|
||||
* \param n new value
|
||||
*/
|
||||
CBotTypResult& GetTypElem() const;
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "CBot/CBotVar/CBotVarInt.h"
|
||||
|
||||
#include "CBot/CBotClass.h"
|
||||
#include "CBot/CBotToken.h"
|
||||
|
||||
#include "CBot/CBotEnums.h"
|
||||
|
||||
|
@ -136,7 +137,7 @@ void CBotVar::Maj(void* pUser, bool bContinu)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CBotVar* CBotVar::Create(const CBotToken* name, int type )
|
||||
CBotVar* CBotVar::Create(const CBotToken* name, CBotType type )
|
||||
{
|
||||
CBotTypResult t(type);
|
||||
return Create(name, t);
|
||||
|
@ -269,7 +270,7 @@ CBotVar* CBotVar::Create(const std::string& n, CBotTypResult type)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CBotVar* CBotVar::Create(const std::string& name, int type, CBotClass* pClass)
|
||||
CBotVar* CBotVar::Create(const std::string& name, CBotType type, CBotClass* pClass)
|
||||
{
|
||||
CBotToken token( name, "" );
|
||||
CBotVar* pVar = Create( &token, type );
|
||||
|
@ -319,13 +320,13 @@ CBotTypResult CBotVar::GetTypResult(int mode)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CBotVar::GetType(int mode)
|
||||
CBotType CBotVar::GetType(int mode)
|
||||
{
|
||||
if ( mode == 1 && m_type.Eq(CBotTypClass) )
|
||||
return CBotTypPointer;
|
||||
if ( mode == 2 && m_type.Eq(CBotTypClass) )
|
||||
return CBotTypIntrinsic;
|
||||
return m_type.GetType();
|
||||
return static_cast<CBotType>(m_type.GetType());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -343,12 +344,12 @@ CBotVar::InitType CBotVar::GetInit() const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CBotVar::SetInit(CBotVar::InitType bInit)
|
||||
void CBotVar::SetInit(CBotVar::InitType initType)
|
||||
{
|
||||
m_binit = bInit;
|
||||
if ( bInit == CBotVar::InitType::IS_POINTER ) m_binit = CBotVar::InitType::DEF; // cas spécial
|
||||
m_binit = initType;
|
||||
if (initType == CBotVar::InitType::IS_POINTER ) m_binit = CBotVar::InitType::DEF; // cas spécial
|
||||
|
||||
if ( m_type.Eq(CBotTypPointer) && bInit == CBotVar::InitType::IS_POINTER )
|
||||
if ( m_type.Eq(CBotTypPointer) && initType == CBotVar::InitType::IS_POINTER )
|
||||
{
|
||||
CBotVarClass* instance = GetPointer();
|
||||
if ( instance == nullptr )
|
||||
|
@ -365,7 +366,7 @@ void CBotVar::SetInit(CBotVar::InitType bInit)
|
|||
CBotVar* p = (static_cast<CBotVarClass*>(this))->m_pVar;
|
||||
while( p != nullptr )
|
||||
{
|
||||
p->SetInit( bInit );
|
||||
p->SetInit(initType);
|
||||
p->m_pMyThis = static_cast<CBotVarClass*>(this);
|
||||
p = p->GetNext();
|
||||
}
|
||||
|
@ -412,7 +413,7 @@ CBotVar* CBotVar::GetItemList()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
CBotVar* CBotVar::GetItem(int row, bool bGrow)
|
||||
CBotVar* CBotVar::GetItem(int index, bool grow)
|
||||
{
|
||||
assert(0);
|
||||
return nullptr;
|
||||
|
@ -521,9 +522,9 @@ bool CBotVar::IsStatic()
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool CBotVar::IsPrivate(ProtectionLevel mode)
|
||||
bool CBotVar::IsPrivate(ProtectionLevel level)
|
||||
{
|
||||
return static_cast<int>(m_mPrivate) >= static_cast<int>(mode);
|
||||
return static_cast<int>(m_mPrivate) >= static_cast<int>(level);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -720,7 +721,7 @@ void CBotVar::Copy(CBotVar* pSrc, bool bName)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CBotVar::SetValString(const std::string& p)
|
||||
void CBotVar::SetValString(const std::string& val)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -19,85 +19,38 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotDefines.h"
|
||||
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarArray class Classe pour les tableaux.
|
||||
/**
|
||||
* \brief CBotVar subclass for managing arrays (::CBotTypArrayPointer)
|
||||
*
|
||||
* Uses CBotVarClass for storing data internally
|
||||
*/
|
||||
class CBotVarArray : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarArray
|
||||
* \param name
|
||||
* \param type
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarArray( const CBotToken* name, CBotTypResult& type );
|
||||
|
||||
/*!
|
||||
* \brief ~CBotVarArray
|
||||
CBotVarArray(const CBotToken* name, CBotTypResult& type);
|
||||
/**
|
||||
* \brief Destructor. Do not call directly, use CBotVar::Destroy()
|
||||
*/
|
||||
~CBotVarArray();
|
||||
|
||||
/*!
|
||||
* \brief SetPointer
|
||||
* \param p
|
||||
*/
|
||||
void SetPointer(CBotVar* p) override;
|
||||
|
||||
/*!
|
||||
* \brief GetPointer
|
||||
* \return
|
||||
*/
|
||||
CBotVarClass* GetPointer() override;
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItem Makes an element according to its numeric index enlarged
|
||||
* the table if necessary if bExtend.
|
||||
* \param n
|
||||
* \param bGrow
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItem(int n, bool bGrow=false) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItemList Gives the first item in the list.
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItem(int n, bool grow = false) override;
|
||||
CBotVar* GetItemList() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString Gets the contents of the array into a string.
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
private:
|
||||
//! Instance manager of table.
|
||||
//! Array data
|
||||
CBotVarClass* m_pInstance;
|
||||
//! My daddy is a buddy.
|
||||
friend class CBotVar;
|
||||
};
|
||||
|
|
|
@ -17,16 +17,13 @@
|
|||
* along with this program. If not, see http://gnu.org/licenses
|
||||
*/
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotVar/CBotVarBoolean.h"
|
||||
|
||||
#include "CBot/CBotEnums.h"
|
||||
#include "CBot/CBotUtils.h"
|
||||
#include "CBot/CBotKeywordStrings.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
#include "CBot/CBotToken.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -19,114 +19,35 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotToken.h"
|
||||
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarBoolean class Class for the management of boolean.
|
||||
/**
|
||||
* \brief CBotVar subclass for managing boolean values (::CBotTypBoolean)
|
||||
*/
|
||||
class CBotVarBoolean : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarBoolean
|
||||
* \param name
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarBoolean( const CBotToken* name );
|
||||
CBotVarBoolean(const CBotToken* name);
|
||||
|
||||
/*!
|
||||
* \brief SetValInt
|
||||
* \param val
|
||||
* \param s
|
||||
*/
|
||||
void SetValInt(int val, const std::string& s = nullptr) override;
|
||||
|
||||
/*!
|
||||
* \brief SetValFloat
|
||||
* \param val
|
||||
*/
|
||||
void SetValFloat(float val) override;
|
||||
|
||||
/*!
|
||||
* \brief GetValInt
|
||||
* \return
|
||||
*/
|
||||
int GetValInt() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValFloat
|
||||
* \return
|
||||
*/
|
||||
float GetValFloat() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief And
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void And(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Or
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Or(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief XOr
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void XOr(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Not
|
||||
*/
|
||||
void Not() override;
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -159,13 +159,6 @@ void CBotVarClass::Copy(CBotVar* pSrc, bool bName)
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CBotVarClass::SetItemList(CBotVar* pVar)
|
||||
{
|
||||
delete m_pVar;
|
||||
m_pVar = pVar; // replaces the existing pointer
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CBotVarClass::SetIdent(long n)
|
||||
{
|
||||
|
|
|
@ -19,175 +19,94 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarClass class Class management class instances.
|
||||
/**
|
||||
* \brief CBotVar subclass for managing classes (::CBotTypClass, ::CBotTypIntrinsic)
|
||||
*
|
||||
* \nosubgrouping
|
||||
*/
|
||||
class CBotVarClass : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarClass
|
||||
* \param name
|
||||
* \param type
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarClass( const CBotToken* name, const CBotTypResult& type );
|
||||
|
||||
/*!
|
||||
* \brief ~CBotVarClass
|
||||
CBotVarClass(const CBotToken* name, const CBotTypResult& type);
|
||||
/**
|
||||
* \brief Destructor. Do not call directly, use CBotVar::Destroy()
|
||||
*/
|
||||
~CBotVarClass();
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief SetClass
|
||||
* \param pClass
|
||||
*/
|
||||
void SetClass(CBotClass* pClass) override;
|
||||
|
||||
/*!
|
||||
* \brief GetClass
|
||||
* \return
|
||||
*/
|
||||
CBotClass* GetClass() override;
|
||||
|
||||
/*!
|
||||
* \brief GetItem Return an element of a class according to its name (*).
|
||||
* \param name
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItem(const std::string& name) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItemRef
|
||||
* \param nIdent
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItemRef(int nIdent) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItem For the management of an array.
|
||||
* \param n
|
||||
* \param bExtend can enlarge the table, but not beyond the threshold size
|
||||
* of SetArray().
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItem(int n, bool bExtend) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItemList
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItemList() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
/*!
|
||||
* \brief Maj
|
||||
* \param pUser
|
||||
* \param bContinue
|
||||
*/
|
||||
void Maj(void* pUser, bool bContinue) override;
|
||||
|
||||
/*!
|
||||
* \brief IncrementUse A reference to incrementation.
|
||||
//! \name Reference counter
|
||||
//@{
|
||||
|
||||
/**
|
||||
* \brief Increment reference counter
|
||||
*/
|
||||
void IncrementUse();
|
||||
|
||||
/*!
|
||||
* \brief DecrementUse A reference to decrementation.
|
||||
/**
|
||||
* \brief Decrement reference counter
|
||||
*/
|
||||
void DecrementUse();
|
||||
|
||||
/*!
|
||||
* \brief GetPointer
|
||||
* \return
|
||||
*/
|
||||
//@}
|
||||
|
||||
CBotVarClass* GetPointer() override;
|
||||
|
||||
/*!
|
||||
* \brief SetItemList
|
||||
* \param pVar
|
||||
*/
|
||||
void SetItemList(CBotVar* pVar);
|
||||
//! \name Unique instance identifier
|
||||
//@{
|
||||
|
||||
/*!
|
||||
* \brief SetIdent
|
||||
* \param n
|
||||
*/
|
||||
void SetIdent(long n) override;
|
||||
|
||||
/*!
|
||||
* \brief Find Makes an instance according to its unique number.
|
||||
* \param id
|
||||
* \return
|
||||
* \brief Finds a class instance by unique identifier
|
||||
* \param id Identifier to find
|
||||
* \return Found class instance
|
||||
*/
|
||||
static CBotVarClass* Find(long id);
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
//@}
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief ConstructorSet
|
||||
*/
|
||||
void ConstructorSet() override;
|
||||
|
||||
private:
|
||||
//! List of existing instances at some point.
|
||||
//! Doubly linked list of all class instances - first
|
||||
static CBotVarClass* m_ExClass;
|
||||
//! For this general list.
|
||||
//! Doubly linked list of all class instances - next
|
||||
CBotVarClass* m_ExNext;
|
||||
//! For this general list.
|
||||
//! Doubly linked list of all class instances - previous
|
||||
CBotVarClass* m_ExPrev;
|
||||
//! The class definition.
|
||||
//! Class definition
|
||||
CBotClass* m_pClass;
|
||||
//! The instance of a parent class.
|
||||
//! Parent class instance
|
||||
CBotVarClass* m_pParent;
|
||||
//! Contents.
|
||||
//! Class members
|
||||
CBotVar* m_pVar;
|
||||
//! Counter usage.
|
||||
//! Reference counter
|
||||
int m_CptUse;
|
||||
//! Identifier (unique) of an instance.
|
||||
//! Identifier (unique) of an instance
|
||||
long m_ItemIdent;
|
||||
//! Set if a constructor has been called.
|
||||
//! Set after constructor is called, allows destructor to be called
|
||||
bool m_bConstructor;
|
||||
|
||||
friend class CBotVar;
|
||||
|
|
|
@ -19,178 +19,45 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include <CBot/CBotEnums.h>
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarFloat class Class for managing real numbers (float).
|
||||
/**
|
||||
* \brief CBotVar subclass for managing float values (::CBotTypFloat)
|
||||
*/
|
||||
class CBotVarFloat : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarFloat
|
||||
* \param name
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarFloat( const CBotToken* name );
|
||||
CBotVarFloat(const CBotToken* name);
|
||||
|
||||
/*!
|
||||
* \brief SetValInt
|
||||
* \param val
|
||||
* \param s
|
||||
*/
|
||||
void SetValInt(int val, const std::string& s = nullptr) override;
|
||||
|
||||
/*!
|
||||
* \brief SetValFloat
|
||||
* \param val
|
||||
*/
|
||||
void SetValFloat(float val) override;
|
||||
|
||||
/*!
|
||||
* \brief GetValInt
|
||||
* \return
|
||||
*/
|
||||
int GetValInt() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValFloat
|
||||
* \return
|
||||
*/
|
||||
float GetValFloat() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief Add Addition.
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Add(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Sub Substraction.
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Sub(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Mul Multiplication.
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Mul(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Div Division.
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
CBotError Div(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Modulo Remainder of division.
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
CBotError Modulo(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Power
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Power(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Lo
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Lo(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hi
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hi(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ls
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ls(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hs
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hs(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Neg
|
||||
*/
|
||||
void Neg() override;
|
||||
|
||||
/*!
|
||||
* \brief Inc
|
||||
*/
|
||||
void Inc() override;
|
||||
|
||||
/*!
|
||||
* \brief Dec
|
||||
*/
|
||||
void Dec() override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,232 +19,55 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include <CBot/CBotEnums.h>
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarInt class Class for the management of integer numbers (int).
|
||||
/**
|
||||
* \brief CBotVar subclass for managing integer values (::CBotTypInt)
|
||||
*/
|
||||
class CBotVarInt : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarInt
|
||||
* \param name
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarInt( const CBotToken* name );
|
||||
CBotVarInt(const CBotToken* name);
|
||||
|
||||
/*!
|
||||
* \brief SetValInt
|
||||
* \param val
|
||||
* \param s
|
||||
*/
|
||||
void SetValInt(int val, const std::string& s = nullptr) override;
|
||||
|
||||
/*!
|
||||
* \brief SetValFloat
|
||||
* \param val
|
||||
*/
|
||||
void SetValInt(int val, const std::string& s = "") override;
|
||||
void SetValFloat(float val) override;
|
||||
|
||||
/*!
|
||||
* \brief GetValInt
|
||||
* \return
|
||||
*/
|
||||
int GetValInt() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValFloat
|
||||
* \return
|
||||
*/
|
||||
float GetValFloat() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable in to another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief Add
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Add(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Sub
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Sub(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Mul
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Mul(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Div
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
CBotError Div(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Modulo
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
CBotError Modulo(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Power
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Power(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Lo
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Lo(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hi
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hi(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ls
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ls(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hs
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hs(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief XOr
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void XOr(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Or
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Or(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief And
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void And(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief SL
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void SL(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief SR
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void SR(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief ASR
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void ASR(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Neg
|
||||
*/
|
||||
void Neg() override;
|
||||
|
||||
/*!
|
||||
* \brief Not
|
||||
*/
|
||||
void Not() override;
|
||||
|
||||
/*!
|
||||
* \brief Inc
|
||||
*/
|
||||
void Inc() override;
|
||||
void SL(CBotVar* left, CBotVar* right) override;
|
||||
void SR(CBotVar* left, CBotVar* right) override;
|
||||
void ASR(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Dec
|
||||
*/
|
||||
void Neg() override;
|
||||
void Inc() override;
|
||||
void Dec() override;
|
||||
|
||||
/*!
|
||||
* \brief Save0State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save0State(FILE* pf) override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,142 +19,56 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarPointer class Class for the management of pointers to a
|
||||
* class instances.
|
||||
/**
|
||||
* \brief CBotVar subclass for managing pointers to classes (::CBotTypPointer)
|
||||
*/
|
||||
class CBotVarPointer : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarPointer
|
||||
* \param name
|
||||
* \param type
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarPointer( const CBotToken* name, CBotTypResult& type );
|
||||
|
||||
/*!
|
||||
* \brief ~CBotVarPointer
|
||||
CBotVarPointer(const CBotToken* name, CBotTypResult& type);
|
||||
/**
|
||||
* \brief Destructor. Do not call directly, use CBotVar::Destroy()
|
||||
*/
|
||||
~CBotVarPointer();
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief SetClass
|
||||
* \param pClass
|
||||
*/
|
||||
void SetClass(CBotClass* pClass) override;
|
||||
|
||||
/*!
|
||||
* \brief GetClass
|
||||
* \return
|
||||
*/
|
||||
CBotClass* GetClass() override;
|
||||
|
||||
/*!
|
||||
* \brief GetItem Return an element of a class according to its name (*).
|
||||
* \param name
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItem(const std::string& name) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItemRef
|
||||
* \param nIdent
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItemRef(int nIdent) override;
|
||||
|
||||
/*!
|
||||
* \brief GetItemList
|
||||
* \return
|
||||
*/
|
||||
CBotVar* GetItemList() override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief SetPointer Initializes the pointer to the instance of a class.
|
||||
* \param p
|
||||
*/
|
||||
void SetPointer(CBotVar* p) override;
|
||||
|
||||
/*!
|
||||
* \brief GetPointer
|
||||
* \return
|
||||
*/
|
||||
CBotVarClass* GetPointer() override;
|
||||
|
||||
/*!
|
||||
* \brief SetIdent Associates an identification number (unique).
|
||||
* \param n
|
||||
*/
|
||||
void SetIdent(long n) override;
|
||||
|
||||
/*!
|
||||
* \brief GetIdent Gives the identification number associated with.
|
||||
* \return
|
||||
/**
|
||||
* \brief Returns the unique instance identifier
|
||||
* \see SetIdent()
|
||||
*/
|
||||
long GetIdent();
|
||||
|
||||
/*!
|
||||
* \brief ConstructorSet
|
||||
*/
|
||||
void ConstructorSet() override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
/*!
|
||||
* \brief Maj
|
||||
* \param pUser
|
||||
* \param bContinue
|
||||
*/
|
||||
void Maj(void* pUser, bool bContinue) override;
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
private:
|
||||
//! Contents.
|
||||
//! Class pointed to
|
||||
CBotVarClass* m_pVarClass;
|
||||
//! Class provided for this pointer.
|
||||
//! Class type
|
||||
CBotClass* m_pClass;
|
||||
friend class CBotVar;
|
||||
};
|
||||
|
|
|
@ -65,9 +65,9 @@ void CBotVarString::Copy(CBotVar* pSrc, bool bName)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CBotVarString::SetValString(const std::string& p)
|
||||
void CBotVarString::SetValString(const std::string& val)
|
||||
{
|
||||
m_val = p;
|
||||
m_val = val;
|
||||
m_binit = CBotVar::InitType::DEF;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,106 +19,33 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// Modules inlcude
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
// Local include
|
||||
|
||||
// Global include
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The CBotVarString class Class for management of strings (String).
|
||||
/**
|
||||
* \brief CBotVar subclass for managing string values (::CBotTypString)
|
||||
*/
|
||||
class CBotVarString : public CBotVar
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief CBotVarString
|
||||
* \param name
|
||||
/**
|
||||
* \brief Constructor. Do not call directly, use CBotVar::Create()
|
||||
*/
|
||||
CBotVarString( const CBotToken* name );
|
||||
CBotVarString(const CBotToken* name);
|
||||
|
||||
/*!
|
||||
* \brief SetValString
|
||||
* \param p
|
||||
*/
|
||||
void SetValString(const std::string& p) override;
|
||||
|
||||
/*!
|
||||
* \brief GetValString
|
||||
* \return
|
||||
*/
|
||||
void SetValString(const std::string& val) override;
|
||||
std::string GetValString() override;
|
||||
|
||||
/*!
|
||||
* \brief Copy Copy a variable into another.
|
||||
* \param pSrc
|
||||
* \param bName
|
||||
*/
|
||||
void Copy(CBotVar* pSrc, bool bName=true) override;
|
||||
void Copy(CBotVar* pSrc, bool bName = true) override;
|
||||
|
||||
/*!
|
||||
* \brief Add
|
||||
* \param left
|
||||
* \param right
|
||||
*/
|
||||
void Add(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Lo
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Lo(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hi
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hi(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ls
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ls(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Hs
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Hs(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Eq
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Eq(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Ne
|
||||
* \param left
|
||||
* \param right
|
||||
* \return
|
||||
*/
|
||||
bool Ne(CBotVar* left, CBotVar* right) override;
|
||||
|
||||
/*!
|
||||
* \brief Save1State
|
||||
* \param pf
|
||||
* \return
|
||||
*/
|
||||
bool Save1State(FILE* pf) override;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue