1 /**********************************************************************
2  *
3  *   FreeDoko a Doppelkopf-Game
4  *
5  *   Copyright (C) 2001 – 2018 by Diether Knof and Borg Enders
6  *
7  *   This program is free software; you can redistribute it and/or
8  *   modify it under the terms of the GNU General Public License as
9  *   published by the Free Software Foundation; either version 2 of
10  *   the License, or (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *   You can find this license in the file 'gpl.txt'.
17  *
18  *   You should have received a copy of the GNU General Public License
19  *   along with this program; if not, write to the Free Software
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  *   MA  02111-1307  USA
22  *
23  *  Contact:
24  *    Diether Knof dknof@posteo.de
25  *
26  **********************************************************************/
27 
28 #pragma once
29 
30 enum class AiconfigHeuristic {
31   error = -1,
32   no_heuristic = 0,
33   manual,
34   bug_report,
35   only_one_valid_card,
36   play_to_marry,
37   play_to_get_married,
38   start_with_color_solo_ace,
39   start_with_color_single_ace,
40   start_with_color_double_ace,
41   jab_with_color_ace,
42   choose_ten,
43   choose_for_color_trick,
44   jab_color_over_fox,
45 
46   start_with_color,
47   start_with_low_color,
48   start_with_low_trump,
49   retry_color,
50   play_color_for_partner,
51   try_color_for_partner,
52   play_color_for_partner_ace,
53   play_bad_color,
54   jab_color_trick_with_dulle,
55   save_dulle,
56   pfund_in_first_color_run,
57   serve_color_trick,
58   serve_trump_trick,
59   choose_pfund,
60   choose_pfund_poverty,
61   choose_pfund_before_partner,
62   jab_for_ace,
63   create_fehl,
64   best_winning,
65   low_high,
66   play_trump,
67   play_for_team,
68   jab_fox,
69   jab_for_doppelkopf,
70   try_for_doppelkopf,
71   play_for_partner_worries,
72   partner_backhand_draw_trump,
73   draw_trump,
74   play_to_jab_later,
75   play_highest_color_card_in_game,
76   jab_to_win,
77   grab_trick,
78   last_player_pass_small_trick,
79   cannot_jab,
80 
81   poverty_special_play_pfund,
82   poverty_special_give_no_points,
83   poverty_special_offer_pfund,
84   poverty_re_trump_color_trick_high,
85   poverty_re_play_trump,
86   poverty_contra_play_color,
87   poverty_contra_trump_color_trick_high,
88   poverty_leave_to_partner,
89   poverty_overjab_re,
90   poverty_best_winning_card,
91 
92   play_color_in_solo,
93 
94   picture_pull_down_color,
95   picture_start_with_highest_color,
96   picture_get_last_trumps,
97   picture_draw_trumps,
98   picture_play_last_trumps,
99   picture_jab_color_trick_for_sure,
100 
101   meatless_start_with_best_color,
102   meatless_retry_last_color,
103 
104   color_jab_for_ace,
105   color_low_high,
106 
107   choose_best_card_in_last_tricks,
108   choose_best_card, // for the database
109 };
110 constexpr AiconfigHeuristic aiconfig_heuristic_list[] = {
111   AiconfigHeuristic::no_heuristic,
112   AiconfigHeuristic::manual,
113   AiconfigHeuristic::bug_report,
114   AiconfigHeuristic::only_one_valid_card,
115   AiconfigHeuristic::play_to_marry,
116   AiconfigHeuristic::play_to_get_married,
117   AiconfigHeuristic::start_with_color_solo_ace,
118   AiconfigHeuristic::start_with_color_single_ace,
119   AiconfigHeuristic::start_with_color_double_ace,
120   AiconfigHeuristic::jab_with_color_ace,
121   AiconfigHeuristic::choose_ten,
122   AiconfigHeuristic::pfund_in_first_color_run,
123   AiconfigHeuristic::choose_for_color_trick,
124   AiconfigHeuristic::jab_color_over_fox,
125 
126   AiconfigHeuristic::start_with_color,
127   AiconfigHeuristic::start_with_low_color,
128   AiconfigHeuristic::start_with_low_trump,
129   AiconfigHeuristic::retry_color,
130   AiconfigHeuristic::play_color_for_partner,
131   AiconfigHeuristic::try_color_for_partner,
132   AiconfigHeuristic::play_color_for_partner_ace,
133   AiconfigHeuristic::play_bad_color,
134   AiconfigHeuristic::jab_color_trick_with_dulle,
135   AiconfigHeuristic::save_dulle,
136   AiconfigHeuristic::serve_color_trick,
137   AiconfigHeuristic::serve_trump_trick,
138   AiconfigHeuristic::choose_pfund,
139   AiconfigHeuristic::choose_pfund_poverty,
140   AiconfigHeuristic::choose_pfund_before_partner,
141   AiconfigHeuristic::jab_for_ace,
142   AiconfigHeuristic::create_fehl,
143   AiconfigHeuristic::best_winning,
144   AiconfigHeuristic::low_high,
145   AiconfigHeuristic::play_trump,
146   AiconfigHeuristic::play_for_team,
147   AiconfigHeuristic::jab_fox,
148   AiconfigHeuristic::jab_for_doppelkopf,
149   AiconfigHeuristic::try_for_doppelkopf,
150   AiconfigHeuristic::play_for_partner_worries,
151   AiconfigHeuristic::partner_backhand_draw_trump,
152   AiconfigHeuristic::draw_trump,
153   AiconfigHeuristic::play_to_jab_later,
154   AiconfigHeuristic::play_highest_color_card_in_game,
155   AiconfigHeuristic::jab_to_win,
156   AiconfigHeuristic::grab_trick,
157   AiconfigHeuristic::last_player_pass_small_trick,
158 
159   AiconfigHeuristic::poverty_special_play_pfund,
160   AiconfigHeuristic::poverty_special_give_no_points,
161   AiconfigHeuristic::poverty_special_offer_pfund,
162   AiconfigHeuristic::poverty_re_trump_color_trick_high,
163   AiconfigHeuristic::poverty_re_play_trump,
164   AiconfigHeuristic::poverty_contra_play_color,
165   AiconfigHeuristic::poverty_contra_trump_color_trick_high,
166   AiconfigHeuristic::poverty_leave_to_partner,
167   AiconfigHeuristic::poverty_overjab_re,
168   AiconfigHeuristic::poverty_best_winning_card,
169 
170   AiconfigHeuristic::play_color_in_solo,
171 
172   AiconfigHeuristic::picture_pull_down_color,
173   AiconfigHeuristic::picture_start_with_highest_color,
174   AiconfigHeuristic::picture_get_last_trumps,
175   AiconfigHeuristic::picture_draw_trumps,
176   AiconfigHeuristic::picture_play_last_trumps,
177   AiconfigHeuristic::picture_jab_color_trick_for_sure,
178 
179   AiconfigHeuristic::meatless_start_with_best_color,
180   AiconfigHeuristic::meatless_retry_last_color,
181 
182   AiconfigHeuristic::color_jab_for_ace,
183   AiconfigHeuristic::color_low_high,
184 
185   AiconfigHeuristic::choose_best_card_in_last_tricks,
186   AiconfigHeuristic::choose_best_card, // for the database
187 };
188 
189 constexpr unsigned aiconfig_heuristic_size = static_cast<int>(AiconfigHeuristic::choose_best_card) + 1;
190 
191 bool is_real(AiconfigHeuristic heuristic);
192 bool is_general(AiconfigHeuristic heuristic);
193 bool for_poverty(AiconfigHeuristic heuristic);
194 bool for_solo(AiconfigHeuristic heuristic);
195 bool for_color_solo(AiconfigHeuristic heuristic);
196 bool for_picture_solo(AiconfigHeuristic heuristic);
197 bool for_meatless_solo(AiconfigHeuristic heuristic);
198 
199 
200 string to_string(AiconfigHeuristic heuristic);
201 AiconfigHeuristic AiconfigHeuristic_from_name(string const& name);
202 
203 ostream& operator<<(ostream& ostr, AiconfigHeuristic heuristic);
204 string gettext(AiconfigHeuristic heuristic);
205 string gettext_description(AiconfigHeuristic heuristic);
206