Whiteboard: made validate_visitor inherit from mapbuilder_visitor

This commit is contained in:
Gabriel Morin 2010-06-30 07:52:11 +00:00
parent c6c1fde5cd
commit 6050f0d617
4 changed files with 13 additions and 10 deletions

View file

@ -27,8 +27,8 @@ namespace wb
mapbuilder_visitor::mapbuilder_visitor(unit_map& unit_map)
: unit_map_(unit_map)
, modifiers_()
, excluded_units_()
, modifiers_()
{
}

View file

@ -49,12 +49,13 @@ public:
// Any actions associated with this unit will be ignored when modifying the unit map
virtual void exclude(const unit& unit) { excluded_units_.insert(&unit); }
private:
protected:
unit_map& unit_map_;
std::stack<modifier_ptr> modifiers_;
std::set<unit const*> excluded_units_;
private:
std::stack<modifier_ptr> modifiers_;
};
}

View file

@ -21,7 +21,8 @@
namespace wb
{
validate_visitor::validate_visitor()
validate_visitor::validate_visitor(unit_map& unit_map)
: mapbuilder_visitor(unit_map)
{
}
@ -29,8 +30,9 @@ validate_visitor::~validate_visitor()
{
}
void validate_visitor::visit_move(move&)
void validate_visitor::visit_move(boost::shared_ptr<move> move)
{
mapbuilder_visitor::visit_move(move);
}

View file

@ -19,18 +19,18 @@
#ifndef WB_VALIDATE_VISITOR_HPP_
#define WB_VALIDATE_VISITOR_HPP_
#include "visitor.hpp"
#include "mapbuilder_visitor.hpp"
namespace wb
{
class validate_visitor: public visitor
class validate_visitor: public mapbuilder_visitor
{
public:
validate_visitor();
validate_visitor(unit_map& unit_map);
virtual ~validate_visitor();
virtual void visit_move(move& p_move);
virtual void visit_move(boost::shared_ptr<move> move);
};
}