mail[Wesnoth-commits] r20043 - /trunk/src/unit_types.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by david on September 01, 2007 - 21:06:
Author: torangan
Date: Sat Sep  1 21:05:51 2007
New Revision: 20043

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20043&view=rev
Log:
initialize all members

Modified:
    trunk/src/unit_types.hpp

Modified: trunk/src/unit_types.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.hpp?rev=20043&r1=20042&r2=20043&view=diff
==============================================================================
--- trunk/src/unit_types.hpp (original)
+++ trunk/src/unit_types.hpp Sat Sep  1 21:05:51 2007
@@ -112,13 +112,10 @@
 //large land, etc etc.
 class unit_movement_type
 {
-       mutable std::map<t_translation::t_letter, int> moveCosts_;
-       mutable std::map<t_translation::t_letter, int> defenseMods_;
-
 public:
        //this class assumes that the passed in reference will remain valid
        //for at least as long as the class instance
-       unit_movement_type(const config& cfg, const unit_movement_type* 
parent=NULL) : cfg_(cfg), parent_(parent) {};
+       unit_movement_type(const config& cfg, const unit_movement_type* 
parent=NULL) : moveCosts_(), defenseMods_(), cfg_(cfg), parent_(parent) {};
 
        const t_string& name() const;
        int movement_cost(const gamemap& map, t_translation::t_letter 
terrain, int recurse_count=0) const;
@@ -137,6 +134,9 @@
        const config& get_cfg() const { return cfg_; }
        const unit_movement_type* get_parent() const { return parent_; }
 private:
+       mutable std::map<t_translation::t_letter, int> moveCosts_;
+       mutable std::map<t_translation::t_letter, int> defenseMods_;
+
        const config cfg_;
 
        const unit_movement_type* parent_;




Related Messages


Powered by MHonArc, Updated Sun Sep 02 00:00:17 2007