[colobot] 97/377: Moving CBotEmpty class in its own header and source files.

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:34:02 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 14961dbc5779fed099c9e5e0ef626c8447e58010
Author: Grunaka <dev at romainbreton.fr>
Date:   Sat Nov 14 11:40:51 2015 +0100

    Moving CBotEmpty class in its own header and source files.
---
 src/CBot/CBot.cpp                | 14 +-----------
 src/CBot/CBot.h                  |  7 ------
 src/CBot/CBotFunction.cpp        |  1 +
 src/CBot/CBotInstr/CBotEmpty.cpp | 40 ++++++++++++++++++++++++++++++++++
 src/CBot/CBotInstr/CBotEmpty.h   | 47 ++++++++++++++++++++++++++++++++++++++++
 src/CBot/CMakeLists.txt          |  1 +
 6 files changed, 90 insertions(+), 20 deletions(-)

diff --git a/src/CBot/CBot.cpp b/src/CBot/CBot.cpp
index d08e01e..e9d4171 100644
--- a/src/CBot/CBot.cpp
+++ b/src/CBot/CBot.cpp
@@ -65,6 +65,7 @@
 #include "CBotInstr/CBotIString.h"
 #include "CBotInstr/CBotFloat.h"
 #include "CBotInstr/CBotBoolean.h"
+#include "CBotInstr/CBotEmpty.h"
 
 
 // Local include
@@ -565,19 +566,6 @@ void CBotInstArray::RestoreState(CBotStack* &pj, bool bMain)
     if (m_next2b ) m_next2b->RestoreState( pile1, bMain);
 }
 
-// special case for empty indexes
-bool CBotEmpty :: Execute(CBotStack* &pj)
-{
-    CBotVar*    pVar = CBotVar::Create("", CBotTypInt);
-    pVar->SetValInt(-1);
-    pj->SetVar(pVar);
-    return true;
-}
-
-void CBotEmpty :: RestoreState(CBotStack* &pj, bool bMain)
-{
-}
-
 //////////////////////////////////////////////////////////////////////////////////////
 // defining a list table initialization
 // int [ ] a [ ] = (( 1, 2, 3 ) , ( 3, 2, 1 )) ;
diff --git a/src/CBot/CBot.h b/src/CBot/CBot.h
index cc1cb2d..5197bd8 100644
--- a/src/CBot/CBot.h
+++ b/src/CBot/CBot.h
@@ -558,13 +558,6 @@ public:
     void        RestoreState(CBotStack* &pj, bool bMain) override;
 };
 
-
-class CBotEmpty : public CBotInstr
-{
-    bool        Execute(CBotStack* &pj) override;
-    void        RestoreState(CBotStack* &pj, bool bMain) override;
-};
-
 #define    MAX(a,b)    ((a>b) ? a : b)
 
 
diff --git a/src/CBot/CBotFunction.cpp b/src/CBot/CBotFunction.cpp
index b672f32..f298f10 100644
--- a/src/CBot/CBotFunction.cpp
+++ b/src/CBot/CBotFunction.cpp
@@ -26,6 +26,7 @@
 #include "CBotInstr/CBotBlock.h"
 #include "CBotInstr/CBotTwoOpExpr.h"
 #include "CBotInstr/CBotExpression.h"
+#include "CBotInstr/CBotEmpty.h"
 
 #include <cassert>
 
diff --git a/src/CBot/CBotInstr/CBotEmpty.cpp b/src/CBot/CBotInstr/CBotEmpty.cpp
new file mode 100644
index 0000000..4f3cb5a
--- /dev/null
+++ b/src/CBot/CBotInstr/CBotEmpty.cpp
@@ -0,0 +1,40 @@
+/*
+ * 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 "CBotEmpty.h"
+
+// Local include
+
+// Global include
+
+
+////////////////////////////////////////////////////////////////////////////////
+bool CBotEmpty::Execute(CBotStack* &pj)
+{
+    CBotVar*    pVar = CBotVar::Create("", CBotTypInt);
+    pVar->SetValInt(-1);
+    pj->SetVar(pVar);
+    return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void CBotEmpty::RestoreState(CBotStack* &pj, bool bMain)
+{
+}
diff --git a/src/CBot/CBotInstr/CBotEmpty.h b/src/CBot/CBotInstr/CBotEmpty.h
new file mode 100644
index 0000000..04f9faf
--- /dev/null
+++ b/src/CBot/CBotInstr/CBotEmpty.h
@@ -0,0 +1,47 @@
+/*
+ * 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 "CBot.h"
+
+// Local include
+
+// Global include
+
+/*!
+ * \brief The CBotEmpty class
+ */
+class CBotEmpty : public CBotInstr
+{
+    /*!
+     * \brief Execute Special case for empty indexes.
+     * \param pj
+     * \return
+     */
+    bool Execute(CBotStack* &pj) override;
+
+    /*!
+     * \brief RestoreState
+     * \param pj
+     * \param bMain
+     */
+    void RestoreState(CBotStack* &pj, bool bMain) override;
+};
diff --git a/src/CBot/CMakeLists.txt b/src/CBot/CMakeLists.txt
index a001e1d..bc2a19e 100644
--- a/src/CBot/CMakeLists.txt
+++ b/src/CBot/CMakeLists.txt
@@ -46,6 +46,7 @@ set(SOURCES
     CBotInstr/CBotIString.cpp
     CBotInstr/CBotFloat.cpp
     CBotInstr/CBotBoolean.cpp
+    CBotInstr/CBotEmpty.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