Skip to content

Commit

Permalink
RCA AI: remove unused function get_recall_list()
Browse files Browse the repository at this point in the history
This also let's us get rid of the friend declaration in recall_list_mamnager.hpp as indicated in the TODO comment.
  • Loading branch information
mattsc committed Nov 16, 2018
1 parent d9b1146 commit f8871d9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
8 changes: 0 additions & 8 deletions src/ai/contexts.cpp
Expand Up @@ -40,7 +40,6 @@
#include "log.hpp" // for LOG_STREAM, logger, etc
#include "map/map.hpp" // for gamemap
#include "pathfind/pathfind.hpp" // for paths::dest_vect, paths, etc
#include "recall_list_manager.hpp" // for recall_list_manager
#include "resources.hpp" // for units, gameboard, etc
#include "serialization/string_utils.hpp" // for split, etc
#include "team.hpp" // for team
Expand Down Expand Up @@ -772,13 +771,6 @@ const moves_map& readonly_context_impl::get_possible_moves() const
}


const std::vector<unit_ptr>& readonly_context_impl::get_recall_list() const
{
///@todo 1.9: check for (level_["disallow_recall"]))
return current_team().recall_list().recall_list_; //TODO: Refactor ai so that friend of ai context is not required of recall_list_manager at this line
}


double readonly_context_impl::get_recruitment_diversity() const
{
if (recruitment_diversity_) {
Expand Down
12 changes: 0 additions & 12 deletions src/ai/contexts.hpp
Expand Up @@ -294,9 +294,6 @@ class readonly_context : public virtual side_context {
virtual const moves_map& get_possible_moves() const = 0;


virtual const std::vector<unit_ptr>& get_recall_list() const = 0;


virtual double get_recruitment_diversity() const = 0;


Expand Down Expand Up @@ -800,12 +797,6 @@ class readonly_context_proxy : public virtual readonly_context, public virtual s
}


virtual const std::vector<unit_ptr>& get_recall_list() const override
{
return target_->get_recall_list();
}


virtual double get_recruitment_diversity() const override
{
return target_->get_recruitment_diversity();
Expand Down Expand Up @@ -1387,9 +1378,6 @@ class readonly_context_impl : public virtual side_context_proxy, public readonly
virtual const moves_map& get_possible_moves() const override;


virtual const std::vector<unit_ptr>& get_recall_list() const override;


virtual double get_recruitment_diversity() const override;


Expand Down
2 changes: 0 additions & 2 deletions src/recall_list_manager.hpp
Expand Up @@ -64,6 +64,4 @@ class recall_list_manager {

private:
std::vector<unit_ptr > recall_list_; //!< The underlying data struture. TODO: Should this be a map based on underlying id instead?

friend class ai::readonly_context_impl; //!< Friend AI module for ease of implementation there.
};

0 comments on commit f8871d9

Please sign in to comment.