remove a never used parameter
This commit is contained in:
parent
c5e77db936
commit
8027fd38e8
7 changed files with 16 additions and 16 deletions
|
@ -60,7 +60,7 @@ struct castle_cost_calculator : cost_calculator
|
|||
castle_cost_calculator(const gamemap& map) : map_(map)
|
||||
{}
|
||||
|
||||
virtual double cost(const map_location&, const map_location& loc, const double) const
|
||||
virtual double cost(const map_location& loc, const double) const
|
||||
{
|
||||
if(!map_.is_castle(loc))
|
||||
return 10000;
|
||||
|
|
|
@ -50,7 +50,7 @@ struct move_cost_calculator : cost_calculator
|
|||
avoid_enemies_(u.usage() == "scout")
|
||||
{}
|
||||
|
||||
virtual double cost(const map_location&, const map_location& loc, const double) const
|
||||
virtual double cost(const map_location& loc, const double) const
|
||||
{
|
||||
/*
|
||||
if(!map_.on_board(loc))
|
||||
|
|
|
@ -141,7 +141,7 @@ plain_route a_star_search(const map_location& src, const map_location& dst,
|
|||
|
||||
DBG_PF << "A* search: " << src << " -> " << dst << '\n';
|
||||
|
||||
if (calc->cost(src,dst, 0) >= stop_at) {
|
||||
if (calc->cost(dst, 0) >= stop_at) {
|
||||
LOG_PF << "aborted A* search because Start or Dest is invalid\n";
|
||||
plain_route locRoute;
|
||||
locRoute.move_cost = int(calc->getNoPathValue());
|
||||
|
@ -189,7 +189,7 @@ plain_route a_star_search(const map_location& src, const map_location& dst,
|
|||
double thresh = (next.in - search_counter <= 1u) ? next.g : stop_at;
|
||||
// cost() is always >= 1 (assumed and needed by the heuristic)
|
||||
if (n.g + 1 >= thresh) continue;
|
||||
double cost = n.g + calc->cost(n.curr, locs[i], n.g);
|
||||
double cost = n.g + calc->cost(locs[i], n.g);
|
||||
if (cost >= thresh) continue;
|
||||
|
||||
bool in_list = next.in == search_counter + 1;
|
||||
|
|
|
@ -287,7 +287,7 @@ struct passage_path_calculator : cost_calculator
|
|||
map_(mapdata), wall_(wall), laziness_(laziness), windiness_(windiness)
|
||||
{}
|
||||
|
||||
virtual double cost(const map_location& src,const map_location& loc, const double so_far) const;
|
||||
virtual double cost(const map_location& loc, const double so_far) const;
|
||||
private:
|
||||
const t_translation::t_map& map_;
|
||||
t_translation::t_terrain wall_;
|
||||
|
@ -295,7 +295,7 @@ private:
|
|||
size_t windiness_;
|
||||
};
|
||||
|
||||
double passage_path_calculator::cost(const map_location& /*src*/,const map_location& loc, const double) const
|
||||
double passage_path_calculator::cost(const map_location& loc, const double) const
|
||||
{
|
||||
assert(loc.x >= 0 && loc.y >= 0 && size_t(loc.x) < map_.size() &&
|
||||
!map_.empty() && size_t(loc.y) < map_.front().size());
|
||||
|
|
|
@ -372,7 +372,7 @@ struct road_path_calculator : cost_calculator
|
|||
{
|
||||
}
|
||||
|
||||
virtual double cost(const location& src, const location& loc, const double so_far) const;
|
||||
virtual double cost(const location& loc, const double so_far) const;
|
||||
|
||||
mutable int calls;
|
||||
private:
|
||||
|
@ -383,7 +383,7 @@ private:
|
|||
mutable std::map<t_translation::t_terrain, double> cache_;
|
||||
};
|
||||
|
||||
double road_path_calculator::cost(const location& /*src*/, const location& loc,
|
||||
double road_path_calculator::cost(const location& loc,
|
||||
const double /*so_far*/) const
|
||||
{
|
||||
++calls;
|
||||
|
@ -1056,7 +1056,7 @@ std::string default_generate_map(size_t width, size_t height, size_t island_size
|
|||
continue;
|
||||
}
|
||||
|
||||
if (calc.cost(src,src, 0.0) >= 1000.0 || calc.cost(src,dst, 0.0) >= 1000.0) {
|
||||
if (calc.cost(src, 0.0) >= 1000.0 || calc.cost(dst, 0.0) >= 1000.0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ shortest_path_calculator::shortest_path_calculator(unit const &u, team const &t,
|
|||
ignore_unit_(ignore_unit), ignore_defense_(ignore_defense)
|
||||
{}
|
||||
|
||||
double shortest_path_calculator::cost(const map_location& /*src*/,const map_location& loc, const double so_far) const
|
||||
double shortest_path_calculator::cost(const map_location& loc, const double so_far) const
|
||||
{
|
||||
assert(map_.on_board(loc));
|
||||
|
||||
|
@ -535,7 +535,7 @@ emergency_path_calculator::emergency_path_calculator(const unit& u, const gamema
|
|||
: unit_(u), map_(map)
|
||||
{}
|
||||
|
||||
double emergency_path_calculator::cost(const map_location&,const map_location& loc, const double) const
|
||||
double emergency_path_calculator::cost(const map_location& loc, const double) const
|
||||
{
|
||||
assert(map_.on_board(loc));
|
||||
|
||||
|
@ -545,7 +545,7 @@ double emergency_path_calculator::cost(const map_location&,const map_location& l
|
|||
dummy_path_calculator::dummy_path_calculator(const unit&, const gamemap&)
|
||||
{}
|
||||
|
||||
double dummy_path_calculator::cost(const map_location&, const map_location&, const double) const
|
||||
double dummy_path_calculator::cost(const map_location&, const double) const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ struct cost_calculator
|
|||
{
|
||||
cost_calculator() {}
|
||||
|
||||
virtual double cost(const map_location& src, const map_location& loc, const double so_far) const = 0;
|
||||
virtual double cost(const map_location& loc, const double so_far) const = 0;
|
||||
virtual ~cost_calculator() {}
|
||||
|
||||
inline double getNoPathValue() const { return (42424242.0); }
|
||||
|
@ -159,7 +159,7 @@ struct shortest_path_calculator : cost_calculator
|
|||
shortest_path_calculator(const unit& u, const team& t, const unit_map& units,
|
||||
const std::vector<team>& teams, const gamemap& map,
|
||||
bool ignore_unit = false, bool ignore_defense_ = false);
|
||||
virtual double cost(const map_location& src, const map_location& loc, const double so_far) const;
|
||||
virtual double cost(const map_location& loc, const double so_far) const;
|
||||
|
||||
private:
|
||||
unit const &unit_;
|
||||
|
@ -180,7 +180,7 @@ private:
|
|||
struct emergency_path_calculator : cost_calculator
|
||||
{
|
||||
emergency_path_calculator(const unit& u, const gamemap& map);
|
||||
virtual double cost(const map_location& src, const map_location& loc, const double so_far) const;
|
||||
virtual double cost(const map_location& loc, const double so_far) const;
|
||||
|
||||
private:
|
||||
unit const &unit_;
|
||||
|
@ -194,7 +194,7 @@ private:
|
|||
struct dummy_path_calculator : cost_calculator
|
||||
{
|
||||
dummy_path_calculator(const unit& u, const gamemap& map);
|
||||
virtual double cost(const map_location& src, const map_location& loc, const double so_far) const;
|
||||
virtual double cost(const map_location& loc, const double so_far) const;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue