From: Michael Andreen Date: Sat, 9 Mar 2002 20:04:18 +0000 (+0000) Subject: initial commit of the BSConf class. X-Git-Tag: HBS_0_1_0~42 X-Git-Url: https://ruin.nu/git/?p=hbs.git;a=commitdiff_plain;h=f1e79e13d76a63700e6345503e338afaa93c102d initial commit of the BSConf class. --- diff --git a/bs/bsconf.cpp b/bs/bsconf.cpp new file mode 100644 index 0000000..45a2f44 --- /dev/null +++ b/bs/bsconf.cpp @@ -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 index 0000000..49a1d75 --- /dev/null +++ b/bs/bsconf.h @@ -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 + +/** + *@author Michael Andreen + */ + +class BSConf : public QObject +{ + Q_Object +public: + BSConf(); + ~BSConf(); +}; + +#endif diff --git a/bs/bsdoc.cpp b/bs/bsdoc.cpp index f26e7e4..a782c08 100644 --- a/bs/bsdoc.cpp +++ b/bs/bsdoc.cpp @@ -17,6 +17,7 @@ #include "bsdoc.h" + BSDoc::BSDoc() { modified = false; diff --git a/bs/bsview.cpp b/bs/bsview.cpp index ec0e213..4f050c0 100644 --- a/bs/bsview.cpp +++ b/bs/bsview.cpp @@ -111,7 +111,7 @@ void BSView::slotDocumentChanged() { 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)); } diff --git a/bs/fleet.cpp b/bs/fleet.cpp index 4989573..c2bf40e 100644 --- a/bs/fleet.cpp +++ b/bs/fleet.cpp @@ -25,6 +25,7 @@ map Fleet::s_Units; Fleet::Fleet() { + m_iETA = 0; } Fleet::~Fleet(){ } @@ -84,3 +85,18 @@ int Fleet::NumberOfShips() return total; } +////////////////////////////////////////////////////////////////////////// +// +void Fleet::setETA(int eta) +{ + m_iETA = eta; +} + +////////////////////////////////////////////////////////////////////////// +// +int Fleet::ETA() +{ + return m_iETA; +} + + diff --git a/bs/fleet.h b/bs/fleet.h index 0d81fd2..7fb4f44 100644 --- a/bs/fleet.h +++ b/bs/fleet.h @@ -64,10 +64,20 @@ public: */ 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; + int m_iETA; std::map > m_Fleet; static std::map s_Units;