The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
stage_rca.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2016 by Yurii Chernyi <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * candidate action evaluator
18  */
19 
20 #ifndef AI_TESTING_STAGE_RCA_HPP_INCLUDED
21 #define AI_TESTING_STAGE_RCA_HPP_INCLUDED
22 
23 #include "ai/composite/rca.hpp"
24 #include "ai/composite/stage.hpp"
25 
26 #ifdef _MSC_VER
27 #pragma warning(push)
28 //silence "inherits via dominance" warnings
29 #pragma warning(disable:4250)
30 #endif
31 
32 namespace ai {
33 
34 namespace ai_default_rca {
35 
36 class candidate_action_evaluation_loop: public virtual stage, public virtual rca_context {
37 public:
38  candidate_action_evaluation_loop( ai_context &context, const config &cfg );
39 
41 
42  bool do_play_stage();
43 
44  void on_create();
45 
46  config to_config() const;
47 
49 
50  void create_candidate_action(std::vector<candidate_action_ptr> &candidate_actions, const config &cfg);
51 
52  void remove_completed_cas();
53 
54 private:
55  std::vector<candidate_action_ptr> candidate_actions_;
56 
57  const config &cfg_;
58 };
59 
60 
61 } // of namespace testing_ai_default
62 
63 } // of namespace ai
64 
65 #ifdef _MSC_VER
66 #pragma warning(pop)
67 #endif
68 
69 #endif
candidate_action_evaluation_loop(ai_context &context, const config &cfg)
Definition: stage_rca.cpp:41
std::vector< candidate_action_ptr > candidate_actions_
Definition: stage_rca.hpp:55
Composite AI stages.
A small explanation about what's going on here: Each action has access to two game_info objects First...
Definition: actions.cpp:57
void create_candidate_action(std::vector< candidate_action_ptr > &candidate_actions, const config &cfg)
Definition: stage_rca.cpp:62
bool do_play_stage()
Play the turn - implementation.
Definition: stage_rca.cpp:86
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
candidate action framework