From f8871d9ad8b4e63a2fb12fa5bc86e22217558b42 Mon Sep 17 00:00:00 2001 From: mattsc Date: Thu, 15 Nov 2018 07:30:50 -0800 Subject: [PATCH] RCA AI: remove unused function get_recall_list() This also let's us get rid of the friend declaration in recall_list_mamnager.hpp as indicated in the TODO comment. --- src/ai/contexts.cpp | 8 -------- src/ai/contexts.hpp | 12 ------------ src/recall_list_manager.hpp | 2 -- 3 files changed, 22 deletions(-) diff --git a/src/ai/contexts.cpp b/src/ai/contexts.cpp index b096277c01af..30a381e7a888 100644 --- a/src/ai/contexts.cpp +++ b/src/ai/contexts.cpp @@ -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 @@ -772,13 +771,6 @@ const moves_map& readonly_context_impl::get_possible_moves() const } -const std::vector& 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_) { diff --git a/src/ai/contexts.hpp b/src/ai/contexts.hpp index b67e00908dd6..838735d5e775 100644 --- a/src/ai/contexts.hpp +++ b/src/ai/contexts.hpp @@ -294,9 +294,6 @@ class readonly_context : public virtual side_context { virtual const moves_map& get_possible_moves() const = 0; - virtual const std::vector& get_recall_list() const = 0; - - virtual double get_recruitment_diversity() const = 0; @@ -800,12 +797,6 @@ class readonly_context_proxy : public virtual readonly_context, public virtual s } - virtual const std::vector& get_recall_list() const override - { - return target_->get_recall_list(); - } - - virtual double get_recruitment_diversity() const override { return target_->get_recruitment_diversity(); @@ -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& get_recall_list() const override; - - virtual double get_recruitment_diversity() const override; diff --git a/src/recall_list_manager.hpp b/src/recall_list_manager.hpp index 09048cf8be6a..2348d341a28e 100644 --- a/src/recall_list_manager.hpp +++ b/src/recall_list_manager.hpp @@ -64,6 +64,4 @@ class recall_list_manager { private: std::vector 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. };