Skip to content

Commit

Permalink
remove unused portrait function from unit
Browse files Browse the repository at this point in the history
This function was entirely unused, and deleting it allows us to
remove the "portrait.hpp" include from the unit.hpp header. (!)
  • Loading branch information
cbeck88 committed Jun 14, 2014
1 parent 15ab52d commit 85de1c2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
14 changes: 0 additions & 14 deletions src/unit.cpp
Expand Up @@ -3086,20 +3086,6 @@ const std::string& unit::effect_image_mods() const{
return image_mods_;
}

const tportrait* unit::portrait(
const unsigned size, const tportrait::tside side) const
{
BOOST_FOREACH(const tportrait& portrait, type().portraits() ) {
if(portrait.size == size
&& (side == portrait.side || portrait.side == tportrait::BOTH)) {

return &portrait;
}
}

return NULL;
}

void unit::remove_attacks_ai()
{
if (attacks_left_ == max_attacks_) {
Expand Down
13 changes: 0 additions & 13 deletions src/unit.hpp
Expand Up @@ -21,7 +21,6 @@
#include <boost/scoped_ptr.hpp>

#include "formula_callable.hpp"
#include "portrait.hpp"
#include "resources.hpp"
#include "unit_animation.hpp"
#include "unit_types.hpp"
Expand Down Expand Up @@ -399,18 +398,6 @@ class unit
const std::string& effect_image_mods() const;
std::string image_mods() const;

/**
* Gets the portrait for a unit.
*
* @param size The size of the portrait.
* @param side The side the portrait is shown on.
*
* @returns The portrait with the wanted size.
* @retval NULL The wanted portrait doesn't exist.
*/
const tportrait* portrait(
const unsigned size, const tportrait::tside side) const;

private:
void advance_to(const config &old_cfg, const unit_type &t,
bool use_traits);
Expand Down

0 comments on commit 85de1c2

Please sign in to comment.