fixed compilation error in MSVC
"ai.hpp(110) : error C2027: use of undefined type 'ai'"
This commit is contained in:
parent
71db1af65d
commit
affcf8c0d8
3 changed files with 16 additions and 13 deletions
14
src/ai.hpp
14
src/ai.hpp
|
@ -37,13 +37,7 @@ public:
|
|||
TYPE type;
|
||||
};
|
||||
|
||||
struct defensive_position {
|
||||
location loc;
|
||||
int chance_to_hit;
|
||||
double vulnerability, support;
|
||||
};
|
||||
|
||||
const defensive_position& best_defensive_position(const location& unit,
|
||||
defensive_position const& best_defensive_position(const location& unit,
|
||||
const move_map& dstsrc, const move_map& srcdst, const move_map& enemy_dstsrc) const;
|
||||
void invalidate_defensive_position_cache();
|
||||
|
||||
|
@ -106,9 +100,9 @@ protected:
|
|||
void analyze(const gamemap& map, unit_map& units,
|
||||
const std::vector<team>& teams,
|
||||
const gamestatus& status, const game_data& gamedata,
|
||||
ai& ai_obj,
|
||||
const ai::move_map& dstsrc, const ai::move_map& srcdst,
|
||||
const ai::move_map& enemy_dstsrc);
|
||||
ai_interface& ai_obj,
|
||||
const ai_interface::move_map& dstsrc, const ai_interface::move_map& srcdst,
|
||||
const ai_interface::move_map& enemy_dstsrc);
|
||||
|
||||
double rating(double aggression, class ai& ai_obj) const;
|
||||
|
||||
|
|
|
@ -282,9 +282,9 @@ std::set<battle_type> weapon_choice_cache;
|
|||
void ai::attack_analysis::analyze(const gamemap& map, unit_map& units,
|
||||
const std::vector<team>& teams,
|
||||
const gamestatus& status, const game_data& gamedata,
|
||||
ai& ai_obj,
|
||||
const ai::move_map& dstsrc, const ai::move_map& srcdst,
|
||||
const ai::move_map& enemy_dstsrc)
|
||||
ai_interface& ai_obj,
|
||||
const ai_interface::move_map& dstsrc, const ai_interface::move_map& srcdst,
|
||||
const ai_interface::move_map& enemy_dstsrc)
|
||||
{
|
||||
const unit_map::const_iterator defend_it = units.find(target);
|
||||
wassert(defend_it != units.end());
|
||||
|
|
|
@ -75,6 +75,15 @@ public:
|
|||
///implement their AI algorithm in this function
|
||||
virtual void play_turn() = 0;
|
||||
|
||||
struct defensive_position {
|
||||
location loc;
|
||||
int chance_to_hit;
|
||||
double vulnerability, support;
|
||||
};
|
||||
|
||||
virtual defensive_position const& best_defensive_position(const location& unit,
|
||||
const move_map& dstsrc, const move_map& srcdst, const move_map& enemy_dstsrc) const { static defensive_position dummy_dp; return dummy_dp; }
|
||||
|
||||
///functions which return a reference to the 'team' object for the AI
|
||||
team& current_team();
|
||||
const team& current_team() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue