Various corrections after boucman's code review

This commit is contained in:
Gabriel Morin 2010-06-16 22:49:25 +00:00
parent 3fe15b2346
commit 1db5bc5919
6 changed files with 14 additions and 4 deletions

View file

@ -67,7 +67,7 @@ bool arrow::set_path(const arrow_path_t &path)
}
}
void arrow::clear_path()
void arrow::reset()
{
invalidate_arrow_path(path_);
symbols_map_.clear();

View file

@ -44,7 +44,7 @@ public:
/// returns false if the received path is invalid
virtual bool set_path(const arrow_path_t &path);
virtual void clear_path();
virtual void reset();
/**
* The string color parameter is in the same format expected by the

View file

@ -32,6 +32,8 @@ static lg::log_domain log_whiteboard("whiteboard");
struct temporary_unit_map_modifier;
class unit_map;
namespace wb {
class action;
@ -54,6 +56,13 @@ public:
virtual void accept(visitor& v) = 0;
virtual void execute() = 0;
/**
* Applies temporarily the result of this action to the unit map, and returns
* the corresponding modifier. Dropping the returned reference will revert
* the changes.
*/
virtual modifier_ptr apply_temp_modifier(unit_map& unit_map) = 0;
};
} // end namespace wb

View file

@ -43,7 +43,7 @@ mapbuilder_visitor::~mapbuilder_visitor()
void mapbuilder_visitor::visit_move(boost::shared_ptr<move> move)
{
if (excluded_units_.count(&move->get_unit()) == 0)
if (excluded_units_.find(&move->get_unit()) == excluded_units_.end())
{
modifiers_.push(move->apply_temp_modifier(unit_map_));
}

View file

@ -53,6 +53,7 @@ move::~move()
}
}
//FIXME: move this out of here if it ends up being used only once
team& get_current_team()
{
int current_side = resources::controller->current_side();

View file

@ -59,7 +59,7 @@ public:
* the corresponding modifier. Dropping the returned reference will revert
* the changes.
*/
modifier_ptr apply_temp_modifier(unit_map& unit_map);
virtual modifier_ptr apply_temp_modifier(unit_map& unit_map);
private:
unit & unit_;