Freeciv-3.1: /fast/freeciv/nightly/S3_1/ai/tex/texaicity.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
texaicity.c File Reference
`#include "log.h"`
`#include "city.h"`
`#include "game.h"`
`#include "map.h"`
`#include "movement.h"`
`#include "tile.h"`
`#include "unit.h"`
`#include "workertask.h"`
`#include "citytools.h"`
`#include "advbuilding.h"`
`#include "advdata.h"`
`#include "autosettlers.h"`
`#include "infracache.h"`
`#include "aidata.h"`
`#include "texaimsg.h"`
`#include "texaiplayer.h"`
`#include "texaicity.h"`

Go to the source code of this file.

## Data Structures

struct | texai_worker_task_req
struct | texai_tile_state

## Macros

#define | TWMP 100

## Enumerations

enum | texai_worker_task_limitation { TWTL_CURRENT_UNITS , TWTL_BUILDABLE_UNITS }

## Functions

static bool | texai_city_worker_task_select (struct ai_type *ait, struct player *pplayer, struct city *pcity, struct worker_task *task, enum texai_worker_task_limitation limit)
void | texai_city_worker_requests_create (struct ai_type *ait, struct player *pplayer, struct city *pcity)
void | texai_city_worker_wants (struct ai_type *ait, struct player *pplayer, struct city *pcity)
static void | texai_tile_worker_task_select (struct player *pplayer, struct city *pcity, struct tile *ptile, int cindex, struct unit_list *units, struct worker_task *worked, struct worker_task *unworked, struct texai_tile_state *state, enum texai_worker_task_limitation limit)
void | texai_req_worker_task_rcv (struct texai_req *req)
void | texai_city_alloc (struct ai_type *ait, struct city *pcity)
void | texai_city_free (struct ai_type *ait, struct city *pcity)

## Macro Definition Documentation

## ◆ TWMP

#define TWMP 100

Definition at line 49 of file texaicity.c.

## Enumeration Type Documentation

## ◆ texai_worker_task_limitation

enum texai_worker_task_limitation

Enumerator
TWTL_CURRENT_UNITS |
TWTL_BUILDABLE_UNITS |

Definition at line 57 of file texaicity.c.

## Function Documentation

## ◆ texai_city_alloc()

void texai_city_alloc | ( | struct ai_type * | ait,
|  | struct city * | pcity
| ) |  |

Initialize city for use with tex AI.

Definition at line 564 of file texaicity.c.

Referenced by texwai_city_alloc().

## ◆ texai_city_free()

void texai_city_free | ( | struct ai_type * | ait,
|  | struct city * | pcity
| ) |  |

Free city from use with tex AI.

Definition at line 577 of file texaicity.c.

Referenced by texwai_city_free().

## ◆ texai_city_worker_requests_create()

void texai_city_worker_requests_create | ( | struct ai_type * | ait,
|  | struct player * | pplayer,
|  | struct city * | pcity
| ) |  |

Create worker request for the city. Only tasks that existing units can do are created.

Definition at line 72 of file texaicity.c.

Referenced by texai_check_messages().

## ◆ texai_city_worker_task_select()

static bool texai_city_worker_task_select | ( | struct ai_type * | ait,
|  | struct player * | pplayer,
|  | struct city * | pcity,
|  | struct worker_task * | task,
|  | enum texai_worker_task_limitation | limit
| ) |  |

static

Select worker task suitable for the city.

Definition at line 443 of file texaicity.c.

Referenced by texai_city_worker_requests_create(), and texai_city_worker_wants().

## ◆ texai_city_worker_wants()

void texai_city_worker_wants | ( | struct ai_type * | ait,
|  | struct player * | pplayer,
|  | struct city * | pcity
| ) |  |

Set wants for worker-type units.

Definition at line 93 of file texaicity.c.

Referenced by texai_check_messages().

## ◆ texai_req_worker_task_rcv()

void texai_req_worker_task_rcv | ( | struct texai_req * | req | ) |

Receive message from thread to main thread.

Definition at line 530 of file texaicity.c.

Referenced by texai_refresh().

## ◆ texai_tile_worker_task_select()

static void texai_tile_worker_task_select | ( | struct player * | pplayer,
|  | struct city * | pcity,
|  | struct tile * | ptile,
|  | int | cindex,
|  | struct unit_list * | units,
|  | struct worker_task * | worked,
|  | struct worker_task * | unworked,
|  | struct texai_tile_state * | state,
|  | enum texai_worker_task_limitation | limit
| ) |  |

static

Select worker task suitable for the tile.

Definition at line 153 of file texaicity.c.

Referenced by texai_city_worker_task_select().