Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ai.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  a_ai_op
struct  a_ai
struct  a_strategy
struct  a_theater
struct  weightelt

Defines

#define side_ai_type(s)   ((s)->aitype)
#define MAXGOALS   30
#define MAXTHEATERS   98
#define ai(s)   ((Strategy *) (s)->ai)
#define strength_est(side, side2, u)   ((ai(side)->strengths[side2->id])[u])
#define allied_strength_est(side, side2, u)   ((ai(side)->alstrengths[side2->id])[u])
#define strength0_est(side, side2, u)   ((ai(side)->strengths0[side2->id])[u])
#define allied_strength0_est(side, side2, u)   ((ai(side)->alstrengths0[side2->id])[u])
#define for_all_theaters(s, th)   for ((th) = ai(s)->theaters; (th) != NULL; (th) = (th)->next) \
#define theater_at(s, x, y)   (ai(s)->theaters ? ai(s)->theatertable[((int) ai(s)->areatheaters[(x)+area.width*(y)])] : NULL)
#define set_theater_at(s, x, y, th)   ((ai(s)->areatheaters[(x)+area.width*(y)]) = (th)->id)
#define for_all_cells_in_theater(s, x, y, th)
#define unit_theater(unit)   ((Theater *) (unit)->aihook)
#define set_unit_theater(unit, theater)   ((unit)->aihook = (char *) (theater))
#define RS_DEVELOP_NEEDED   4
#define RS_DEVELOP_ASSIGNED   3
#define RS_UPGRADE_NEEDED   1

Typedefs

typedef enum a_game_class GameClass
typedef a_ai_op AI_ops
typedef a_ai AI
typedef a_strategy Strategy
typedef a_theater Theater

Enumerations

enum  a_game_class { gc_none, gc_standard, gc_time, gc_advanced }

Functions

void try_to_draw (Side *side, int flag, char *ainame)
void give_up (Side *side, char *ainame)
int goal_truth (Side *side, Goal *goal)
int accelerable (int u)
int accelerator (int u1, int u2)
GameClass find_game_class (void)
void update_unit_plans (Side *side)
void update_unit_plans_randomly (Side *side)
int need_this_type_to_collect (Side *side, int u, int m)
void assign_to_collection (Side *side, Unit *unit, int m)
void assign_to_improve (Side *side, Unit *unit)
int assign_to_colonize (Side *side, Unit *unit)
void assign_to_defend_unit (Unit *unit, Unit *unit2)
void assign_to_exploration (Side *side, Unit *unit)
void assign_explorer_to_theater (Side *side, Unit *unit, Theater *theater)
void assign_to_explorer_construction (Side *side, Unit *unit)
void assign_to_offense (Side *side, Unit *unit)
void assign_to_offense_support (Side *side, Unit *unit)
void assign_to_colonization_support (Side *side, Unit *unit)
void assign_to_defense (Side *side, Unit *unit)
void assign_to_defense_support (Side *side, Unit *unit)
int preferred_build_type (Side *side, Unit *unit, int plantype)
int can_develop_on (int u, int u2)
int needs_develop (Side *side, int u)
int assign_to_develop_on (Side *side, Unit *unit, int u2)
int build_depot_for_self (Unit *unit)
int desired_direction_impassable (Unit *unit, int x, int y)
int could_be_ferried (Unit *unit, int x, int y)
int blocked_by_enemy (Unit *unit, int x, int y, int shortest)
int attack_blockage (Side *side, Unit *unit, int x, int y, int shortest)
int enemy_close_by (Side *side, Unit *unit, int dist, int *xp, int *yp)
int suitable_port (Unit *unit)
int need_more_transportation (Side *side)
int need_explorers (Side *side)
void add_goal (Side *side, Goal *goal)
Goal * has_goal (Side *side, GoalType goaltype)
Goal * has_unsatisfied_goal (Side *side, GoalType goaltype)

Variables

GameClass game_class
int bhw_max


Detailed Description

Declaration of AI structs, functions, and enums.

Define Documentation

#define ai (  s   )     ((Strategy *) (s)->ai)
 

#define allied_strength0_est (  side,
side2,
u   )     ((ai(side)->alstrengths0[side2->id])[u])
 

#define allied_strength_est (  side,
side2,
u   )     ((ai(side)->alstrengths[side2->id])[u])
 

#define for_all_cells_in_theater (  s,
x,
y,
th   ) 
 

Value:

{ \
  for ((x) = theater->xmin; (x) < theater->xmax; ++(x))  \
    for ((y) = theater->ymin; (y) < theater->ymax; ++(y))  \
      if (theater_at((s), (x), (y)) == (th))  }

#define for_all_theaters (  s,
th   )     for ((th) = ai(s)->theaters; (th) != NULL; (th) = (th)->next) \
 

#define MAXGOALS   30
 

#define MAXTHEATERS   98
 

#define RS_DEVELOP_ASSIGNED   3
 

#define RS_DEVELOP_NEEDED   4
 

#define RS_UPGRADE_NEEDED   1
 

#define set_theater_at (  s,
x,
y,
th   )     ((ai(s)->areatheaters[(x)+area.width*(y)]) = (th)->id)
 

#define set_unit_theater (  unit,
theater   )     ((unit)->aihook = (char *) (theater))
 

#define side_ai_type (  s   )     ((s)->aitype)
 

#define strength0_est (  side,
side2,
u   )     ((ai(side)->strengths0[side2->id])[u])
 

#define strength_est (  side,
side2,
u   )     ((ai(side)->strengths[side2->id])[u])
 

#define theater_at (  s,
x,
y   )     (ai(s)->theaters ? ai(s)->theatertable[((int) ai(s)->areatheaters[(x)+area.width*(y)])] : NULL)
 

#define unit_theater (  unit   )     ((Theater *) (unit)->aihook)
 


Typedef Documentation

typedef struct a_ai AI
 

typedef struct a_ai_op AI_ops
 

AI operation?

typedef enum a_game_class GameClass
 

This enum defines the type of game for the AI

typedef struct a_strategy Strategy
 

typedef struct a_theater Theater
 


Enumeration Type Documentation

enum a_game_class
 

This enum defines the type of game for the AI

Enumeration values:
gc_none  No game class defined
gc_standard  Standard game class.
gc_time  Time-like game class.
gc_advanced  Advanced (game with advances?) game class


Function Documentation

int accelerable (  int  u  ) 
 

int accelerator (  int  u1,
int  u2
) 
 

void add_goal (  Side *  side,
Goal *  goal
) 
 

void assign_explorer_to_theater (  Side *  side,
Unit *  unit,
Theater *  theater
) 
 

void assign_to_collection (  Side *  side,
Unit *  unit,
int  m
) 
 

void assign_to_colonization_support (  Side *  side,
Unit *  unit
) 
 

int assign_to_colonize (  Side *  side,
Unit *  unit
) 
 

void assign_to_defend_unit (  Unit *  unit,
Unit *  unit2
) 
 

void assign_to_defense (  Side *  side,
Unit *  unit
) 
 

void assign_to_defense_support (  Side *  side,
Unit *  unit
) 
 

int assign_to_develop_on (  Side *  side,
Unit *  unit,
int  u2
) 
 

void assign_to_exploration (  Side *  side,
Unit *  unit
) 
 

void assign_to_explorer_construction (  Side *  side,
Unit *  unit
) 
 

void assign_to_improve (  Side *  side,
Unit *  unit
) 
 

void assign_to_offense (  Side *  side,
Unit *  unit
) 
 

void assign_to_offense_support (  Side *  side,
Unit *  unit
) 
 

int attack_blockage (  Side *  side,
Unit *  unit,
int  x,
int  y,
int  shortest
) 
 

int blocked_by_enemy (  Unit *  unit,
int  x,
int  y,
int  shortest
) 
 

int build_depot_for_self (  Unit *  unit  ) 
 

int can_develop_on (  int  u,
int  u2
) 
 

int could_be_ferried (  Unit *  unit,
int  x,
int  y
) 
 

int desired_direction_impassable (  Unit *  unit,
int  x,
int  y
) 
 

int enemy_close_by (  Side *  side,
Unit *  unit,
int  dist,
int *  xp,
int *  yp
) 
 

GameClass find_game_class (  void   ) 
 

void give_up (  Side *  side,
char *  ainame
) 
 

int goal_truth (  Side *  side,
Goal *  goal
) 
 

Goal* has_goal (  Side *  side,
GoalType  goaltype
) 
 

Goal* has_unsatisfied_goal (  Side *  side,
GoalType  goaltype
) 
 

int need_explorers (  Side *  side  ) 
 

int need_more_transportation (  Side *  side  ) 
 

int need_this_type_to_collect (  Side *  side,
int  u,
int  m
) 
 

int needs_develop (  Side *  side,
int  u
) 
 

int preferred_build_type (  Side *  side,
Unit *  unit,
int  plantype
) 
 

int suitable_port (  Unit *  unit  ) 
 

void try_to_draw (  Side *  side,
int  flag,
char *  ainame
) 
 

void update_unit_plans (  Side *  side  ) 
 

void update_unit_plans_randomly (  Side *  side  ) 
 


Variable Documentation

int bhw_max
 

GameClass game_class
 


Generated on Sat Sep 17 10:28:55 2005 for XconqKernel by doxygen 1.3.6