From 595e711e719a6e6b675b1f40e3e141cd9b770fd9 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sat, 6 Apr 2002 20:57:14 +0000 Subject: [PATCH] some changes --- bs/fleet.h | 2 +- bs/planet.cpp | 31 +++++++++++++++++++++++++++++-- bs/planet.h | 7 +++++-- bs/ui/roidseditview.ui | 29 ++++++++++++++++------------- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/bs/fleet.h b/bs/fleet.h index b90b15e..9a0995a 100644 --- a/bs/fleet.h +++ b/bs/fleet.h @@ -85,7 +85,7 @@ public: * \param tick tells the function what tick you want the score from. 0 is * initial score before the fleet has landed. */ - virtual unsigned score(int tick = 0) const; + unsigned score(int tick = 0) const; void setFleet(std::string unittype, int number); int fleet(std::string unittype, int tick = 0); diff --git a/bs/planet.cpp b/bs/planet.cpp index e8954e1..4fa6978 100644 --- a/bs/planet.cpp +++ b/bs/planet.cpp @@ -26,12 +26,39 @@ Planet::Planet() Planet::~Planet(){ } -unsigned Planet::score(int tick = 0) +////////////////////////////////////////////////////////////////////////// +// +unsigned Planet::planetScore() const { return m_iScore; } -void Planet::setScore(unsigned i) +////////////////////////////////////////////////////////////////////////// +// +void Planet::setPlanetScore(unsigned i) { m_iScore = i; } + +////////////////////////////////////////////////////////////////////////// +// +int roids(std::string type, int tick = 0) const +{ + ticks = m_Roids[type].size(); + if( ticks == 0) + return 0; + if (ticks < tick) + return m_Roids[type][ticks]; + return m_Roids[type][tick]; +} + +////////////////////////////////////////////////////////////////////////// +// +void setRoids(std::string type, int number) +{ + if (m_Roids[type].size() == 0) + m_Roids.push_back(number); + m_Roids[type][0] = number; +} + + diff --git a/bs/planet.h b/bs/planet.h index ccb2ee4..5e2b13a 100644 --- a/bs/planet.h +++ b/bs/planet.h @@ -36,8 +36,11 @@ public: Planet(); virtual ~Planet(); - unsigned score(int tick = 0); - void setScore(unsigned i); + unsigned planetScore() const; + void setPlanetScore(unsigned i); + + int roids(std::string type, int tick = 0) const; + void setRoids(std::string type, int number); protected: unsigned m_iScore; diff --git a/bs/ui/roidseditview.ui b/bs/ui/roidseditview.ui index 5e7afcd..cc48579 100644 --- a/bs/ui/roidseditview.ui +++ b/bs/ui/roidseditview.ui @@ -9,7 +9,7 @@ 0 0 - 227 + 236 115 @@ -45,12 +45,12 @@ - LineEdit31 + EoniumEdit - LineEdit32 + UninitEdit @@ -63,12 +63,12 @@ - LineEdit26 + MetalEdit - LineEdit27 + MetalLostEdit NoFocus @@ -95,12 +95,12 @@ - LineEdit29 + CrystalEdit - LineEdit28 + CrystalLostEdit NoFocus @@ -119,7 +119,7 @@ - LineEdit30 + EoniumLostEdit NoFocus @@ -130,7 +130,7 @@ - LineEdit33 + UninitLostEdit NoFocus @@ -166,14 +166,17 @@ - LineEdit26 - LineEdit29 - LineEdit31 - LineEdit32 + MetalEdit + CrystalEdit + EoniumEdit + UninitEdit roidseditview.ui.h + + changed(const QString&, int) + -- 2.39.2