widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #02307
[Merge] lp:~widelands-dev/widelands/mapobject_cleanup_soldier into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/mapobject_cleanup_soldier into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1341082 in widelands: "Building help: clean up name, descname"
https://bugs.launchpad.net/widelands/+bug/1341082
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/mapobject_cleanup_soldier/+merge/226754
MapObject cleanup for the Soldier object
--
https://code.launchpad.net/~widelands-dev/widelands/mapobject_cleanup_soldier/+merge/226754
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/mapobject_cleanup_soldier into lp:widelands.
=== modified file 'src/logic/soldier.h'
--- src/logic/soldier.h 2014-07-05 16:41:51 +0000
+++ src/logic/soldier.h 2014-07-14 22:49:50 +0000
@@ -193,20 +193,6 @@
(const Tribe_Descr &, uint32_t & w, uint32_t & h);
void draw_info_icon(RenderTarget &, Point, bool anchor_below) const;
- // Information function from description.
- uint32_t get_max_hp_level () const {
- return descr().get_max_hp_level();
- }
- uint32_t get_max_attack_level () const {
- return descr().get_max_attack_level();
- }
- uint32_t get_max_defense_level() const {
- return descr().get_max_defense_level();
- }
- uint32_t get_max_evade_level () const {
- return descr().get_max_evade_level();
- }
-
uint32_t get_current_hitpoints() const {return m_hp_current;}
uint32_t get_max_hitpoints() const;
uint32_t get_min_attack() const;
=== modified file 'src/wui/soldierlist.cc'
--- src/wui/soldierlist.cc 2014-07-13 14:36:19 +0000
+++ src/wui/soldierlist.cc 2014-07-14 22:49:50 +0000
@@ -255,9 +255,9 @@
// Check whether health and/or level of the soldier has changed
Soldier * soldier = icon.soldier.get(egbase());
uint32_t level = soldier->get_attack_level();
- level = level * (soldier->get_max_defense_level() + 1) + soldier->get_defense_level();
- level = level * (soldier->get_max_evade_level() + 1) + soldier->get_evade_level();
- level = level * (soldier->get_max_hp_level() + 1) + soldier->get_hp_level();
+ level = level * (soldier->descr().get_max_defense_level() + 1) + soldier->get_defense_level();
+ level = level * (soldier->descr().get_max_evade_level() + 1) + soldier->get_evade_level();
+ level = level * (soldier->descr().get_max_hp_level() + 1) + soldier->get_hp_level();
uint32_t health = soldier->get_current_hitpoints();
@@ -476,10 +476,10 @@
m_infotext.set_text(
(boost::format(_("HP: %1$u/%2$u AT: %3$u/%4$u DE: %5$u/%6$u EV: %7$u/%8$u"))
- % soldier->get_hp_level() % soldier->get_max_hp_level()
- % soldier->get_attack_level() % soldier->get_max_attack_level()
- % soldier->get_defense_level() % soldier->get_max_defense_level()
- % soldier->get_evade_level() % soldier->get_max_evade_level()
+ % soldier->get_hp_level() % soldier->descr().get_max_hp_level()
+ % soldier->get_attack_level() % soldier->descr().get_max_attack_level()
+ % soldier->get_defense_level() % soldier->descr().get_max_defense_level()
+ % soldier->get_evade_level() % soldier->descr().get_max_evade_level()
).str()
);
}
Follow ups