make advance_to() return a reference.
This commit is contained in:
parent
441949239e
commit
c260e58bae
3 changed files with 5 additions and 5 deletions
|
@ -1258,7 +1258,7 @@ public:
|
|||
ss << "\n";
|
||||
|
||||
// Print cross-references to units that this unit advances from.
|
||||
std::vector<std::string> from_units = type_.advances_from();
|
||||
const std::vector<std::string>& from_units = type_.advances_from();
|
||||
if (!from_units.empty())
|
||||
{
|
||||
ss << _("Advances from: ");
|
||||
|
@ -1287,7 +1287,7 @@ public:
|
|||
|
||||
// Print the units this unit can advance to. Cross reference
|
||||
// to the topics containing information about those units.
|
||||
std::vector<std::string> next_units = type_.advances_to();
|
||||
const std::vector<std::string>& next_units = type_.advances_to();
|
||||
if (!next_units.empty()) {
|
||||
ss << _("Advances to: ");
|
||||
for (std::vector<std::string>::const_iterator advance_it = next_units.begin(),
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
|
||||
/** Advances this unit to another type */
|
||||
void advance_to(const unit_type* t, bool use_traits=false, game_state* state = 0);
|
||||
const std::vector<std::string> advances_to() const { return advances_to_; }
|
||||
const std::vector<std::string>& advances_to() const { return advances_to_; }
|
||||
|
||||
/** The type id of the unit */
|
||||
const std::string& type_id() const { return type_; }
|
||||
|
|
|
@ -216,8 +216,8 @@ public:
|
|||
const unit_movement_type& movement_type() const { return movementType_; }
|
||||
|
||||
int experience_needed(bool with_acceleration=true) const;
|
||||
std::vector<std::string> advances_to() const { return advances_to_; }
|
||||
std::vector<std::string> advances_from() const { return advances_from_; }
|
||||
const std::vector<std::string>& advances_to() const { return advances_to_; }
|
||||
const std::vector<std::string>& advances_from() const { return advances_from_; }
|
||||
config::const_child_itors modification_advancements() const
|
||||
{ return cfg_.child_range("advancement"); }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue