Author: silene
Date: Fri May 8 10:41:46 2009
New Revision: 35482
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35482&view=rev
Log:
Added unit::get_role. Renamed unit::assign_role.
Modified:
trunk/src/game_events.cpp
trunk/src/unit.hpp
Modified: trunk/src/game_events.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_events.cpp?rev=35482&r1=35481&r2=35482&view=diff
==============================================================================
--- trunk/src/game_events.cpp (original)
+++ trunk/src/game_events.cpp Fri May 8 10:41:46 2009
@@ -1722,7 +1722,7 @@
unit_map::iterator itor;
for (itor = rsrc.units->begin(); itor !=
rsrc.units->end(); ++itor) {
if(game_events::unit_matches_filter(itor,
filter)) {
- itor->second.assign_role(cfg["role"]);
+ itor->second.set_role(cfg["role"]);
found = true;
break;
}
@@ -1761,7 +1761,7 @@
u.set_game_context(rsrc.units,
rsrc.game_map, rsrc.status_ptr, rsrc.teams);
scoped_recall_unit
auto_store("this_unit", player_id, i);
if(game_events::unit_matches_filter(u, filter, map_location())) {
-
u.assign_role(cfg["role"]);
+ u.set_role(cfg["role"]);
found=true;
break;
}
Modified: trunk/src/unit.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=35482&r1=35481&r2=35482&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Fri May 8 10:41:46 2009
@@ -187,7 +187,9 @@
void write(config& cfg) const;
// void write(config_writer& out) const;
- void assign_role(const std::string& role) { role_ = role; }
+ void set_role(const std::string& role) { role_ = role; }
+ const std::string &get_role() const { return role_; }
+
void assign_ai_special(const std::string& s) { ai_special_ = s;}
std::string get_ai_special() const { return(ai_special_); }
const std::vector<attack_type>& attacks() const { return attacks_; }
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits