]> ruin.nu Git - hbs.git/commitdiff
initial commit of the BSConf class.
authorMichael Andreen <harv@ruin.nu>
Sat, 9 Mar 2002 20:04:18 +0000 (20:04 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 9 Mar 2002 20:04:18 +0000 (20:04 +0000)
bs/bsconf.cpp [new file with mode: 0644]
bs/bsconf.h [new file with mode: 0644]
bs/bsdoc.cpp
bs/bsview.cpp
bs/fleet.cpp
bs/fleet.h

diff --git a/bs/bsconf.cpp b/bs/bsconf.cpp
new file mode 100644 (file)
index 0000000..45a2f44
--- /dev/null
@@ -0,0 +1,23 @@
+/***************************************************************************
+                          bsconf.cpp  -  description
+                             -------------------
+    begin                : Sat Mar 9 2002
+    copyright            : (C) 2002 by Michael Andreen
+    email                : whale@linux.nu
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "bsconf.h"
+
+BSConf::BSConf(){
+}
+BSConf::~BSConf(){
+}
diff --git a/bs/bsconf.h b/bs/bsconf.h
new file mode 100644 (file)
index 0000000..49a1d75
--- /dev/null
@@ -0,0 +1,35 @@
+/***************************************************************************
+                          bsconf.h  -  description
+                             -------------------
+    begin                : Sat Mar 9 2002
+    copyright            : (C) 2002 by Michael Andreen
+    email                : whale@linux.nu
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef BSCONF_H
+#define BSCONF_H
+
+#include <qobject.h>
+
+/**
+  *@author Michael Andreen
+  */
+
+class BSConf : public QObject
+{
+       Q_Object
+public: 
+       BSConf();
+       ~BSConf();
+};
+
+#endif
index f26e7e4d66a83104368eb41af05bcc5c1e1f74eb..a782c08412f9f8dcf1c70a9480cb84489feded9b 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "bsdoc.h"
 
 
 #include "bsdoc.h"
 
+
 BSDoc::BSDoc()
 {
   modified = false;
 BSDoc::BSDoc()
 {
   modified = false;
index ec0e2135da6f5dec708c71b66009ad89b36ccf24..4f050c03601967fa42c1eb43a362dc8d84c220cb 100644 (file)
@@ -111,7 +111,7 @@ void BSView::slotDocumentChanged()
                        {       
                                int ships = battles[b][g][(*k).first].NumberOfShips();
                                groupShips += ships;
                        {       
                                int ships = battles[b][g][(*k).first].NumberOfShips();
                                groupShips += ships;
-                               (void) new QListViewItem(group, (*k).first, QString("%1").arg(ships));
+                               (void) new QListViewItem(group, (*k).first, QString("%1").arg(ships), QString("%1").arg(battles[b][g][(*k).first].ETA()));
                        }
                        group->setText(1, QString("%1").arg(groupShips));
                }
                        }
                        group->setText(1, QString("%1").arg(groupShips));
                }
index 4989573d87f069b3e3bd6e27c4b009e9a0e7268c..c2bf40ed4b634e5399f2f08e03bc7b1a8669ac64 100644 (file)
@@ -25,6 +25,7 @@ map<string, UnitType > Fleet::s_Units;
 
 Fleet::Fleet()
 {
 
 Fleet::Fleet()
 {
+       m_iETA = 0;
 }
 Fleet::~Fleet(){
 }
 }
 Fleet::~Fleet(){
 }
@@ -84,3 +85,18 @@ int Fleet::NumberOfShips()
        return total;
 }
 
        return total;
 }
 
+//////////////////////////////////////////////////////////////////////////
+//
+void Fleet::setETA(int eta)
+{
+       m_iETA = eta;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+int  Fleet::ETA()
+{
+       return m_iETA;
+}
+
+
index 0d81fd2b5de4637c15d5970385ee77d29a10f495..7fb4f44d182a884119dd9e8773450c49310e91e1 100644 (file)
@@ -64,10 +64,20 @@ public:
         */
        int NumberOfShips();
 
         */
        int NumberOfShips();
 
+       /**Sets the estimated time of arrival. The time as a single integer,
+        * in relation to the current time. For example if the current time is
+        * 10, and the arrival is at 12, then the eta is 2.
+        */
+       void setETA(int eta);
+       /**Return the estimated time of arrival. It's counted from the current time (tick).
+        */
+       int  ETA();
+
 
 protected:
        std::string     m_sName;
        std::string     m_sRace;
 
 protected:
        std::string     m_sName;
        std::string     m_sRace;
+       int         m_iETA;
        std::map<std::string, std::vector<int> >        m_Fleet;
 
        static std::map<std::string, UnitType>  s_Units;
        std::map<std::string, std::vector<int> >        m_Fleet;
 
        static std::map<std::string, UnitType>  s_Units;