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

task.c File Reference

#include "conq.h"
#include "kernel.h"
#include "aiutil.h"
#include "aiunit.h"
#include "aiunit2.h"
#include "task.def"

Include dependency graph for task.c:

Include dependency graph

Defines

#define INITMAXTASKS   100
#define DEF_TASK(name, dname, code, argtypes, DOFN, createfn, setfn, netsetfn, pushfn, netpushfn, argdecl)   static TaskOutcome DOFN(Unit *unit, Task *task);
#define DEF_TASK(NAME, DNAME, code, ARGTYPES, DOFN, createfn, setfn, netsetfn, pushfn, netpushfn, argdecl)   { NAME, DNAME, ARGTYPES, DOFN },

Enumerations

enum  choicestate {
  eitherway, leftthenright, rightthenleft, leftonly,
  rightonly
}

Functions

void init_tasks (void)
Taskcreate_task (TaskType type)
Taskclone_task (Task *oldtask)
Unitfind_unit_to_complete (Unit *unit, Task *task)
int target_visible (Unit *unit, Task *task)
int direct_access_to (int x, int y)
int can_resupply_from_here (int x, int y)
int can_auto_resupply_self (Unit *unit, int *materials, int numtypes)
TaskOutcome execute_task (Unit *unit)
int choose_move_direction (Unit *unit, int x, int y, int range)
int choose_move_dirs (Unit *unit, int tx, int ty, int shortest, int(*dirtest)(Unit *, int), void(*dirsort)(Unit *, int *, int), int *dirs)
int plausible_move_dir (Unit *unit, int dir)
void sort_directions (Unit *unit, int *dirs, int numdirs)
void free_task (Task *task)
void add_task (Unit *unit, int pos, Task *task)
Taskcreate_build_task (Unit *unit, int id, int cp)
void set_build_task (Unit *unit, int id, int cp)
void push_build_task (Unit *unit, int id, int cp)
Taskcreate_capture_task (Unit *unit, int id, int capmethod, int n)
void set_capture_task (Unit *unit, int id, int capmethod, int n)
void push_capture_task (Unit *unit, int id, int capmethod, int n)
Taskcreate_collect_task (Unit *unit, int m, int x, int y)
void set_collect_task (Unit *unit, int m, int x, int y)
Taskcreate_disband_task (Unit *unit)
void set_disband_task (Unit *unit)
Taskcreate_hit_unit_task (Unit *unit, int id, int hitmethod, int n)
void set_hit_unit_task (Unit *unit, int id, int hitmethod, int n)
void push_hit_unit_task (Unit *unit, int id, int hitmethod, int n)
Taskcreate_move_dir_task (Unit *unit, int dir, int n)
void set_move_dir_task (Unit *unit, int dir, int n)
void push_move_dir_task (Unit *unit, int dir, int n)
Taskcreate_move_to_task (Unit *unit, int x, int y, int dist)
void set_move_to_task (Unit *unit, int x, int y, int dist)
void push_move_to_task (Unit *unit, int x, int y, int dist)
Taskcreate_occupy_task (Unit *unit, Unit *transport)
void set_occupy_task (Unit *unit, Unit *transport)
void push_occupy_task (Unit *unit, Unit *transport)
Taskcreate_pickup_task (Unit *unit, Unit *occ)
void push_pickup_task (Unit *unit, Unit *occ)
Taskcreate_produce_task (Unit *unit, int m, int n)
void push_produce_task (Unit *unit, int m, int n)
Taskcreate_construct_task (Unit *unit, int u, int run, int transid, int x, int y)
void set_construct_task (Unit *unit, int u, int run, int transid, int x, int y)
void push_construct_task (Unit *unit, int u, int run, int transid, int x, int y)
Taskcreate_repair_task (Unit *unit, int id, int hp)
void set_repair_task (Unit *unit, int id, int hp)
void push_repair_task (Unit *unit, int id, int hp)
Taskcreate_develop_task (Unit *unit, int u2, int n)
void set_develop_task (Unit *unit, int u2, int techgoal)
void push_develop_task (Unit *unit, int u2, int techgoal)
Taskcreate_resupply_task (Unit *unit, int m)
void set_resupply_task (Unit *unit, int m)
Taskcreate_sentry_task (Unit *unit, int n)
void set_sentry_task (Unit *unit, int n)
void push_sentry_task (Unit *unit, int n)
int parse_location (Side *side, char *arg, int *xp, int *yp)
Unitparse_unit (Side *side, char *arg)
char * parse_task (Side *side, char *str, Task **taskp)
char * task_desig (Task *task)

Variables

TaskDefn taskdefns []
 Task definition array.

Taskfreetasks
char * taskbuf
int * lowm = NULL
int numlow = 0
int xs [NUMDIRS]
int ys [NUMDIRS]
int terrs [NUMDIRS]

Define Documentation

#define DEF_TASK NAME,
DNAME,
code,
ARGTYPES,
DOFN,
createfn,
setfn,
netsetfn,
pushfn,
netpushfn,
argdecl   )     { NAME, DNAME, ARGTYPES, DOFN },
 

#define DEF_TASK name,
dname,
code,
argtypes,
DOFN,
createfn,
setfn,
netsetfn,
pushfn,
netpushfn,
argdecl   )     static TaskOutcome DOFN(Unit *unit, Task *task);
 

#define INITMAXTASKS   100
 


Enumeration Type Documentation

enum choicestate
 

Enumeration values:
eitherway 
leftthenright 
rightthenleft 
leftonly 
rightonly 


Function Documentation

void add_task Unit unit,
int  pos,
Task task
 

int can_auto_resupply_self Unit unit,
int *  materials,
int  numtypes
 

int can_resupply_from_here int  x,
int  y
 

int choose_move_direction Unit unit,
int  x,
int  y,
int  range
 

int choose_move_dirs Unit unit,
int  tx,
int  ty,
int  shortest,
int(*  dirtest)(Unit *, int),
void(*  dirsort)(Unit *, int *, int),
int *  dirs
 

Task* clone_task Task oldtask  ) 
 

Task* create_build_task Unit unit,
int  id,
int  cp
 

Task* create_capture_task Unit unit,
int  id,
int  capmethod,
int  n
 

Task* create_collect_task Unit unit,
int  m,
int  x,
int  y
 

Task* create_construct_task Unit unit,
int  u,
int  run,
int  transid,
int  x,
int  y
 

Task* create_develop_task Unit unit,
int  u2,
int  n
 

Task* create_disband_task Unit unit  ) 
 

Task* create_hit_unit_task Unit unit,
int  id,
int  hitmethod,
int  n
 

Task* create_move_dir_task Unit unit,
int  dir,
int  n
 

Task* create_move_to_task Unit unit,
int  x,
int  y,
int  dist
 

Task* create_occupy_task Unit unit,
Unit transport
 

Task* create_pickup_task Unit unit,
Unit occ
 

Task* create_produce_task Unit unit,
int  m,
int  n
 

Task* create_repair_task Unit unit,
int  id,
int  hp
 

Task* create_resupply_task Unit unit,
int  m
 

Task* create_sentry_task Unit unit,
int  n
 

Task* create_task TaskType  type  ) 
 

int direct_access_to int  x,
int  y
 

TaskOutcome execute_task Unit unit  ) 
 

Unit* find_unit_to_complete Unit unit,
Task task
 

void free_task Task task  ) 
 

void init_tasks void   ) 
 

int parse_location Side side,
char *  arg,
int *  xp,
int *  yp
 

char* parse_task Side side,
char *  str,
Task **  taskp
 

Unit * parse_unit Side side,
char *  arg
 

int plausible_move_dir Unit unit,
int  dir
 

void push_build_task Unit unit,
int  id,
int  cp
 

void push_capture_task Unit unit,
int  id,
int  capmethod,
int  n
 

void push_construct_task Unit unit,
int  u,
int  run,
int  transid,
int  x,
int  y
 

void push_develop_task Unit unit,
int  u2,
int  techgoal
 

void push_hit_unit_task Unit unit,
int  id,
int  hitmethod,
int  n
 

void push_move_dir_task Unit unit,
int  dir,
int  n
 

void push_move_to_task Unit unit,
int  x,
int  y,
int  dist
 

void push_occupy_task Unit unit,
Unit transport
 

void push_pickup_task Unit unit,
Unit occ
 

void push_produce_task Unit unit,
int  m,
int  n
 

void push_repair_task Unit unit,
int  id,
int  hp
 

void push_sentry_task Unit unit,
int  n
 

void set_build_task Unit unit,
int  id,
int  cp
 

void set_capture_task Unit unit,
int  id,
int  capmethod,
int  n
 

void set_collect_task Unit unit,
int  m,
int  x,
int  y
 

void set_construct_task Unit unit,
int  u,
int  run,
int  transid,
int  x,
int  y
 

void set_develop_task Unit unit,
int  u2,
int  techgoal
 

void set_disband_task Unit unit  ) 
 

void set_hit_unit_task Unit unit,
int  id,
int  hitmethod,
int  n
 

void set_move_dir_task Unit unit,
int  dir,
int  n
 

void set_move_to_task Unit unit,
int  x,
int  y,
int  dist
 

void set_occupy_task Unit unit,
Unit transport
 

void set_repair_task Unit unit,
int  id,
int  hp
 

void set_resupply_task Unit unit,
int  m
 

void set_sentry_task Unit unit,
int  n
 

void sort_directions Unit unit,
int *  dirs,
int  numdirs
 

int target_visible Unit unit,
Task task
 

char* task_desig Task task  ) 
 


Variable Documentation

Task* freetasks
 

int* lowm = NULL
 

int numlow = 0
 

char* taskbuf
 

TaskDefn taskdefns[]
 

Task definition array.

int terrs[NUMDIRS]
 

int xs[NUMDIRS]
 

int ys[NUMDIRS]
 


Generated on Sat Sep 17 10:29:38 2005 for XconqKernel by doxygen 1.3.6