[colobot] 117/377: Moving CBotVarInt class in its own header and source files.
Didier Raboud
odyx at moszumanska.debian.org
Wed Mar 30 13:34:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit a4f14650c6a6b1070f5d155b14daab33d43c525b
Author: Grunaka <dev at romainbreton.fr>
Date: Sun Nov 15 21:52:05 2015 +0100
Moving CBotVarInt class in its own header and source files.
---
src/CBot/CBot.h | 54 --------
src/CBot/CBotStack.cpp | 18 ---
src/CBot/CBotVar.cpp | 235 +-------------------------------
src/CBot/CBotVar/CBotVarInt.cpp | 295 ++++++++++++++++++++++++++++++++++++++++
src/CBot/CBotVar/CBotVarInt.h | 255 ++++++++++++++++++++++++++++++++++
src/CBot/CMakeLists.txt | 1 +
6 files changed, 552 insertions(+), 306 deletions(-)
diff --git a/src/CBot/CBot.h b/src/CBot/CBot.h
index a742d47..98d3f9c 100644
--- a/src/CBot/CBot.h
+++ b/src/CBot/CBot.h
@@ -222,60 +222,6 @@ public:
#define MAX(a,b) ((a>b) ? a : b)
-
-// class for the management of integer numbers (int)
-class CBotVarInt : public CBotVar
-{
-private:
- int m_val; // the value
- CBotString m_defnum; // the name if given by DefineNum
- friend class CBotVar;
-
-public:
- CBotVarInt( const CBotToken* name );
-// ~CBotVarInt();
-
- void SetValInt(int val, const char* s = nullptr) override;
- void SetValFloat(float val) override;
- int GetValInt() override;
- float GetValFloat() override;
- CBotString GetValString() override;
-
- void Copy(CBotVar* pSrc, bool bName=true) override;
-
-
- void Add(CBotVar* left, CBotVar* right) override; // addition
- void Sub(CBotVar* left, CBotVar* right) override; // substraction
- void Mul(CBotVar* left, CBotVar* right) override; // multiplication
- int Div(CBotVar* left, CBotVar* right) override; // division
- int Modulo(CBotVar* left, CBotVar* right) override; // remainder of division
- void Power(CBotVar* left, CBotVar* right) override; // power
-
- bool Lo(CBotVar* left, CBotVar* right) override;
- bool Hi(CBotVar* left, CBotVar* right) override;
- bool Ls(CBotVar* left, CBotVar* right) override;
- bool Hs(CBotVar* left, CBotVar* right) override;
- bool Eq(CBotVar* left, CBotVar* right) override;
- bool Ne(CBotVar* left, CBotVar* right) override;
-
- void XOr(CBotVar* left, CBotVar* right) override;
- void Or(CBotVar* left, CBotVar* right) override;
- void And(CBotVar* left, CBotVar* right) override;
-
- void SL(CBotVar* left, CBotVar* right) override;
- void SR(CBotVar* left, CBotVar* right) override;
- void ASR(CBotVar* left, CBotVar* right) override;
-
- void Neg() override;
- void Not() override;
- void Inc() override;
- void Dec() override;
-
- bool Save0State(FILE* pf) override;
- bool Save1State(FILE* pf) override;
-
-};
-
extern CBotInstr* CompileParams(CBotToken* &p, CBotCStack* pStack, CBotVar** ppVars);
extern bool TypeCompatible( CBotTypResult& type1, CBotTypResult& type2, int op = 0 );
diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp
index e831008..63ee21d 100644
--- a/src/CBot/CBotStack.cpp
+++ b/src/CBot/CBotStack.cpp
@@ -973,24 +973,6 @@ bool CBotVar::Save0State(FILE* pf)
}
////////////////////////////////////////////////////////////////////////////////
-bool CBotVarInt::Save0State(FILE* pf)
-{
- if ( !m_defnum.IsEmpty() )
- {
- if(!WriteWord(pf, 200 )) return false; // special marker
- if(!WriteString(pf, m_defnum)) return false; // name of the value
- }
-
- return CBotVar::Save0State(pf);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-bool CBotVarInt::Save1State(FILE* pf)
-{
- return WriteWord(pf, m_val); // the value of the variable
-}
-
-////////////////////////////////////////////////////////////////////////////////
bool CBotVarClass::Save1State(FILE* pf)
{
if ( !WriteType(pf, m_type) ) return false;
diff --git a/src/CBot/CBotVar.cpp b/src/CBot/CBotVar.cpp
index 154405e..74bfb64 100644
--- a/src/CBot/CBotVar.cpp
+++ b/src/CBot/CBotVar.cpp
@@ -33,6 +33,7 @@
#include "CBotVar/CBotVarBoolean.h"
#include "CBotVar/CBotVarString.h"
#include "CBotVar/CBotVarFloat.h"
+#include "CBotVar/CBotVarInt.h"
#include "CBotDefines.h"
#include "CBotClass.h"
@@ -57,22 +58,6 @@ CBotVar::CBotVar( )
m_mPrivate = 0;
}
-CBotVarInt::CBotVarInt( const CBotToken* name )
-{
- m_token = new CBotToken(name);
- m_next = nullptr;
- m_pMyThis = nullptr;
- m_pUserPtr = nullptr;
- m_InitExpr = nullptr;
- m_LimExpr = nullptr;
- m_type = CBotTypInt;
- m_binit = InitType::UNDEF;
- m_bStatic = false;
- m_mPrivate = 0;
-
- m_val = 0;
-}
-
CBotVar::~CBotVar( )
{
delete m_token;
@@ -711,224 +696,6 @@ CBotClass* CBotVar::GetClass()
return nullptr;
}
-/*
-void CBotVar::SetIndirection(CBotVar* pVar)
-{
- // nop, only CBotVarPointer::SetIndirection
-}
-*/
-
-//////////////////////////////////////////////////////////////////////////////////////
-
-// copy a variable in to another
-void CBotVarInt::Copy(CBotVar* pSrc, bool bName)
-{
- CBotVarInt* p = static_cast<CBotVarInt*>(pSrc);
-
- if ( bName) *m_token = *p->m_token;
- m_type = p->m_type;
- m_val = p->m_val;
- m_binit = p->m_binit;
- m_pMyThis = nullptr;
- m_pUserPtr = p->m_pUserPtr;
-
- // identificator is the same (by défaut)
- if (m_ident == 0 ) m_ident = p->m_ident;
-
- m_defnum = p->m_defnum;
-}
-
-
-
-
-void CBotVarInt::SetValInt(int val, const char* defnum)
-{
- m_val = val;
- m_binit = CBotVar::InitType::DEF;
- m_defnum = defnum;
-}
-
-
-
-void CBotVarInt::SetValFloat(float val)
-{
- m_val = static_cast<int>(val);
- m_binit = CBotVar::InitType::DEF;
-}
-
-int CBotVarInt::GetValInt()
-{
- return m_val;
-}
-
-float CBotVarInt::GetValFloat()
-{
- return static_cast<float>(m_val);
-}
-
-CBotString CBotVarInt::GetValString()
-{
- if ( !m_defnum.IsEmpty() ) return m_defnum;
-
- CBotString res;
-
- if ( m_binit == CBotVar::InitType::UNDEF )
- {
- res.LoadString(TX_UNDEF);
- return res;
- }
-
- if ( m_binit == CBotVar::InitType::IS_NAN )
- {
- res.LoadString(TX_NAN);
- return res;
- }
-
- char buffer[300];
- sprintf(buffer, "%d", m_val);
- res = buffer;
-
- return res;
-}
-
-
-void CBotVarInt::Mul(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() * right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::Power(CBotVar* left, CBotVar* right)
-{
- m_val = static_cast<int>( pow( static_cast<double>( left->GetValInt()) , static_cast<double>( left->GetValInt()) ));
- m_binit = CBotVar::InitType::DEF;
-}
-
-int CBotVarInt::Div(CBotVar* left, CBotVar* right)
-{
- int r = right->GetValInt();
- if ( r != 0 )
- {
- m_val = left->GetValInt() / r;
- m_binit = CBotVar::InitType::DEF;
- }
- return ( r == 0 ? TX_DIVZERO : 0 );
-}
-
-int CBotVarInt::Modulo(CBotVar* left, CBotVar* right)
-{
- int r = right->GetValInt();
- if ( r != 0 )
- {
- m_val = left->GetValInt() % r;
- m_binit = CBotVar::InitType::DEF;
- }
- return ( r == 0 ? TX_DIVZERO : 0 );
-}
-
-void CBotVarInt::Add(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() + right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::Sub(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() - right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::XOr(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() ^ right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::And(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() & right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::Or(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() | right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::SL(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() << right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::ASR(CBotVar* left, CBotVar* right)
-{
- m_val = left->GetValInt() >> right->GetValInt();
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::SR(CBotVar* left, CBotVar* right)
-{
- int source = left->GetValInt();
- int shift = right->GetValInt();
- if (shift>=1) source &= 0x7fffffff;
- m_val = source >> shift;
- m_binit = CBotVar::InitType::DEF;
-}
-
-void CBotVarInt::Neg()
-{
- m_val = -m_val;
-}
-
-void CBotVarInt::Not()
-{
- m_val = ~m_val;
-}
-
-void CBotVarInt::Inc()
-{
- m_val++;
- m_defnum.Empty();
-}
-
-void CBotVarInt::Dec()
-{
- m_val--;
- m_defnum.Empty();
-}
-
-bool CBotVarInt::Lo(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() < right->GetValInt();
-}
-
-bool CBotVarInt::Hi(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() > right->GetValInt();
-}
-
-bool CBotVarInt::Ls(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() <= right->GetValInt();
-}
-
-bool CBotVarInt::Hs(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() >= right->GetValInt();
-}
-
-bool CBotVarInt::Eq(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() == right->GetValInt();
-}
-
-bool CBotVarInt::Ne(CBotVar* left, CBotVar* right)
-{
- return left->GetValInt() != right->GetValInt();
-}
-
////////////////////////////////////////////////////////////////
// copy a variable into another
diff --git a/src/CBot/CBotVar/CBotVarInt.cpp b/src/CBot/CBotVar/CBotVarInt.cpp
new file mode 100644
index 0000000..76f89c1
--- /dev/null
+++ b/src/CBot/CBotVar/CBotVarInt.cpp
@@ -0,0 +1,295 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsitec.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+// Modules inlcude
+#include "CBotVarInt.h"
+
+#include "CBotToken.h"
+
+#include "CBotUtils.h"
+
+// Local include
+
+// Global include
+#include <cmath>
+
+////////////////////////////////////////////////////////////////////////////////
+CBotVarInt::CBotVarInt( const CBotToken* name )
+{
+ m_token = new CBotToken(name);
+ m_next = nullptr;
+ m_pMyThis = nullptr;
+ m_pUserPtr = nullptr;
+ m_InitExpr = nullptr;
+ m_LimExpr = nullptr;
+ m_type = CBotTypInt;
+ m_binit = InitType::UNDEF;
+ m_bStatic = false;
+ m_mPrivate = 0;
+
+ m_val = 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Copy(CBotVar* pSrc, bool bName)
+{
+ CBotVarInt* p = static_cast<CBotVarInt*>(pSrc);
+
+ if ( bName) *m_token = *p->m_token;
+ m_type = p->m_type;
+ m_val = p->m_val;
+ m_binit = p->m_binit;
+ m_pMyThis = nullptr;
+ m_pUserPtr = p->m_pUserPtr;
+
+ // identificator is the same (by défaut)
+ if (m_ident == 0 ) m_ident = p->m_ident;
+
+ m_defnum = p->m_defnum;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::SetValInt(int val, const char* defnum)
+{
+ m_val = val;
+ m_binit = CBotVar::InitType::DEF;
+ m_defnum = defnum;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::SetValFloat(float val)
+{
+ m_val = static_cast<int>(val);
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int CBotVarInt::GetValInt()
+{
+ return m_val;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+float CBotVarInt::GetValFloat()
+{
+ return static_cast<float>(m_val);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+CBotString CBotVarInt::GetValString()
+{
+ if ( !m_defnum.IsEmpty() ) return m_defnum;
+
+ CBotString res;
+
+ if ( m_binit == CBotVar::InitType::UNDEF )
+ {
+ res.LoadString(TX_UNDEF);
+ return res;
+ }
+
+ if ( m_binit == CBotVar::InitType::IS_NAN )
+ {
+ res.LoadString(TX_NAN);
+ return res;
+ }
+
+ char buffer[300];
+ sprintf(buffer, "%d", m_val);
+ res = buffer;
+
+ return res;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Mul(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() * right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Power(CBotVar* left, CBotVar* right)
+{
+ m_val = static_cast<int>( pow( static_cast<double>( left->GetValInt()) , static_cast<double>( left->GetValInt()) ));
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int CBotVarInt::Div(CBotVar* left, CBotVar* right)
+{
+ int r = right->GetValInt();
+ if ( r != 0 )
+ {
+ m_val = left->GetValInt() / r;
+ m_binit = CBotVar::InitType::DEF;
+ }
+ return ( r == 0 ? TX_DIVZERO : 0 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+int CBotVarInt::Modulo(CBotVar* left, CBotVar* right)
+{
+ int r = right->GetValInt();
+ if ( r != 0 )
+ {
+ m_val = left->GetValInt() % r;
+ m_binit = CBotVar::InitType::DEF;
+ }
+ return ( r == 0 ? TX_DIVZERO : 0 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Add(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() + right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Sub(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() - right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::XOr(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() ^ right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::And(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() & right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Or(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() | right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::SL(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() << right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::ASR(CBotVar* left, CBotVar* right)
+{
+ m_val = left->GetValInt() >> right->GetValInt();
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::SR(CBotVar* left, CBotVar* right)
+{
+ int source = left->GetValInt();
+ int shift = right->GetValInt();
+ if (shift>=1) source &= 0x7fffffff;
+ m_val = source >> shift;
+ m_binit = CBotVar::InitType::DEF;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Neg()
+{
+ m_val = -m_val;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Not()
+{
+ m_val = ~m_val;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Inc()
+{
+ m_val++;
+ m_defnum.Empty();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotVarInt::Dec()
+{
+ m_val--;
+ m_defnum.Empty();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Lo(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() < right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Hi(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() > right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Ls(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() <= right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Hs(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() >= right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Eq(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() == right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Ne(CBotVar* left, CBotVar* right)
+{
+ return left->GetValInt() != right->GetValInt();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Save0State(FILE* pf)
+{
+ if ( !m_defnum.IsEmpty() )
+ {
+ if(!WriteWord(pf, 200 )) return false; // special marker
+ if(!WriteString(pf, m_defnum)) return false; // name of the value
+ }
+
+ return CBotVar::Save0State(pf);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotVarInt::Save1State(FILE* pf)
+{
+ return WriteWord(pf, m_val); // the value of the variable
+}
diff --git a/src/CBot/CBotVar/CBotVarInt.h b/src/CBot/CBotVar/CBotVarInt.h
new file mode 100644
index 0000000..741fdc1
--- /dev/null
+++ b/src/CBot/CBotVar/CBotVarInt.h
@@ -0,0 +1,255 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsitec.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+// Modules inlcude
+#include "CBotDll.h"
+
+// Local include
+
+// Global include
+
+
+/*!
+ * \brief The CBotVarInt class Class for the management of integer numbers (int).
+ */
+class CBotVarInt : public CBotVar
+{
+public:
+
+ /*!
+ * \brief CBotVarInt
+ * \param name
+ */
+ CBotVarInt( const CBotToken* name );
+
+ /*!
+ * \brief SetValInt
+ * \param val
+ * \param s
+ */
+ void SetValInt(int val, const char* 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
+ */
+ CBotString GetValString() override;
+
+ /*!
+ * \brief Copy Copy a variable in to another.
+ * \param pSrc
+ * \param bName
+ */
+ 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
+ */
+ int Div(CBotVar* left, CBotVar* right) override;
+
+ /*!
+ * \brief Modulo
+ * \param left
+ * \param right
+ * \return
+ */
+ int 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;
+
+ /*!
+ * \brief Dec
+ */
+ void Dec() override;
+
+ /*!
+ * \brief Save0State
+ * \param pf
+ * \return
+ */
+ bool Save0State(FILE* pf) override;
+
+ /*!
+ * \brief Save1State
+ * \param pf
+ * \return
+ */
+ bool Save1State(FILE* pf) override;
+
+private:
+ //! The value.
+ int m_val;
+ //! The name if given by DefineNum.
+ CBotString m_defnum;
+ friend class CBotVar;
+};
diff --git a/src/CBot/CMakeLists.txt b/src/CBot/CMakeLists.txt
index 33474db..6e8a803 100644
--- a/src/CBot/CMakeLists.txt
+++ b/src/CBot/CMakeLists.txt
@@ -61,6 +61,7 @@ set(SOURCES
CBotVar/CBotVarBoolean.cpp
CBotVar/CBotVarString.cpp
CBotVar/CBotVarFloat.cpp
+ CBotVar/CBotVarInt.cpp
)
# Includes
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list