Freeciv21
Develop your civilization from humble roots to a global empire
aidata.h File Reference
#include <QHash>
#include "support.h"
#include "fc_types.h"
#include "tech.h"
#include "advtools.h"
#include "specenum_gen.h"
+ Include dependency graph for aidata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ai_dip_intel
 
struct  ai_plr
 

Macros

#define SPECENUM_NAME   war_reason
 
#define SPECENUM_VALUE0   DAI_WR_BEHAVIOUR
 
#define SPECENUM_VALUE0NAME   "Behaviour"
 
#define SPECENUM_VALUE1   DAI_WR_SPACE
 
#define SPECENUM_VALUE1NAME   "Space"
 
#define SPECENUM_VALUE2   DAI_WR_EXCUSE
 
#define SPECENUM_VALUE2NAME   "Excuse"
 
#define SPECENUM_VALUE3   DAI_WR_HATRED
 
#define SPECENUM_VALUE3NAME   "Hatred"
 
#define SPECENUM_VALUE4   DAI_WR_ALLIANCE
 
#define SPECENUM_VALUE4NAME   "Alliance"
 
#define SPECENUM_VALUE5   DAI_WR_NONE
 
#define SPECENUM_VALUE5NAME   "None"
 

Enumerations

enum  winning_strategy { WIN_OPEN , WIN_SPACE , WIN_CAPITAL }
 

Functions

void dai_data_init (struct ai_type *ait, struct player *pplayer)
 Initialize ai data structure. More...
 
void dai_data_close (struct ai_type *ait, struct player *pplayer)
 Deinitialize ai data structure. More...
 
void dai_data_phase_begin (struct ai_type *ait, struct player *pplayer, bool is_new_phase)
 Make and cache lots of calculations needed for other functions. More...
 
void dai_data_phase_finished (struct ai_type *ait, struct player *pplayer)
 Clean up ai data after phase finished. More...
 
bool is_ai_data_phase_open (struct ai_type *ait, struct player *pplayer)
 Return whether data phase is currently open. More...
 
struct ai_plrdai_plr_data_get (struct ai_type *ait, struct player *pplayer, bool *caller_closes)
 Get current default ai data related to player. More...
 
struct ai_dip_inteldai_diplomacy_get (struct ai_type *ait, const struct player *plr1, const struct player *plr2)
 Returns diplomatic state type between two players. More...
 
void dai_gov_value (struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override)
 Set value of the government. More...
 
void dai_adjust_policies (struct ai_type *ait, struct player *pplayer)
 Adjust multiplier values. More...
 

Macro Definition Documentation

◆ SPECENUM_NAME

#define SPECENUM_NAME   war_reason

Definition at line 31 of file aidata.h.

◆ SPECENUM_VALUE0

#define SPECENUM_VALUE0   DAI_WR_BEHAVIOUR

Definition at line 32 of file aidata.h.

◆ SPECENUM_VALUE0NAME

#define SPECENUM_VALUE0NAME   "Behaviour"

Definition at line 33 of file aidata.h.

◆ SPECENUM_VALUE1

#define SPECENUM_VALUE1   DAI_WR_SPACE

Definition at line 34 of file aidata.h.

◆ SPECENUM_VALUE1NAME

#define SPECENUM_VALUE1NAME   "Space"

Definition at line 35 of file aidata.h.

◆ SPECENUM_VALUE2

#define SPECENUM_VALUE2   DAI_WR_EXCUSE

Definition at line 36 of file aidata.h.

◆ SPECENUM_VALUE2NAME

#define SPECENUM_VALUE2NAME   "Excuse"

Definition at line 37 of file aidata.h.

◆ SPECENUM_VALUE3

#define SPECENUM_VALUE3   DAI_WR_HATRED

Definition at line 38 of file aidata.h.

◆ SPECENUM_VALUE3NAME

#define SPECENUM_VALUE3NAME   "Hatred"

Definition at line 39 of file aidata.h.

◆ SPECENUM_VALUE4

#define SPECENUM_VALUE4   DAI_WR_ALLIANCE

Definition at line 40 of file aidata.h.

◆ SPECENUM_VALUE4NAME

#define SPECENUM_VALUE4NAME   "Alliance"

Definition at line 41 of file aidata.h.

◆ SPECENUM_VALUE5

#define SPECENUM_VALUE5   DAI_WR_NONE

Definition at line 42 of file aidata.h.

◆ SPECENUM_VALUE5NAME

#define SPECENUM_VALUE5NAME   "None"

Definition at line 43 of file aidata.h.

Enumeration Type Documentation

◆ winning_strategy

Enumerator
WIN_OPEN 
WIN_SPACE 
WIN_CAPITAL 

Definition at line 25 of file aidata.h.

Function Documentation

◆ dai_adjust_policies()

void dai_adjust_policies ( struct ai_type ait,
struct player pplayer 
)

Adjust multiplier values.

Definition at line 437 of file aidata.cpp.

Referenced by dai_do_last_activities().

◆ dai_data_close()

void dai_data_close ( struct ai_type ait,
struct player pplayer 
)

Deinitialize ai data structure.

Definition at line 98 of file aidata.cpp.

Referenced by dai_player_free(), tai_player_free(), and texai_player_free().

◆ dai_data_init()

void dai_data_init ( struct ai_type ait,
struct player pplayer 
)

Initialize ai data structure.

Definition at line 50 of file aidata.cpp.

Referenced by dai_player_alloc(), tai_player_alloc(), and texai_player_alloc().

◆ dai_data_phase_begin()

void dai_data_phase_begin ( struct ai_type ait,
struct player pplayer,
bool  is_new_phase 
)

Make and cache lots of calculations needed for other functions.

Definition at line 138 of file aidata.cpp.

Referenced by cai_data_phase_begin(), dai_plr_data_get(), texwai_phase_begin(), and twai_phase_begin().

◆ dai_data_phase_finished()

void dai_data_phase_finished ( struct ai_type ait,
struct player pplayer 
)

◆ dai_diplomacy_get()

◆ dai_gov_value()

void dai_gov_value ( struct ai_type ait,
struct player pplayer,
struct government gov,
adv_want val,
bool *  override 
)

Set value of the government.

Definition at line 533 of file aidata.cpp.

Referenced by cai_gov_value(), texwai_gov_value(), and twai_gov_value().

◆ dai_plr_data_get()

struct ai_plr* dai_plr_data_get ( struct ai_type ait,
struct player pplayer,
bool *  caller_closes 
)

Get current default ai data related to player.

If close is set, data phase will be opened even if it's currently closed, and the boolean will be set accordingly to tell caller that phase needs closing.

Definition at line 304 of file aidata.cpp.

Referenced by cityresult_fill(), contemplate_terrain_improvements(), dai_auto_settler_reset(), dai_diplomacy_actions(), dai_diplomacy_begin_new_phase(), dai_goldequiv_clause(), dai_player_copy(), dai_treaty_accepted(), dai_war_desire(), domestic_advisor_choose_build(), kill_something_with(), tdc_plr_get(), tdc_plr_set(), and texai_city_worker_wants().

◆ is_ai_data_phase_open()

bool is_ai_data_phase_open ( struct ai_type ait,
struct player pplayer 
)

Return whether data phase is currently open.

Data phase is open between dai_data_phase_begin() and dai_data_phase_finished() calls.

Definition at line 128 of file aidata.cpp.