Freeciv-3.3: /fast/freeciv/nightly/main/common/clientutils.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Functions
clientutils.c File Reference
`#include "astring.h"`
`#include "combat.h"`
`#include "extras.h"`
`#include "fc_types.h"`
`#include "game.h"`
`#include "tile.h"`
`#include "world_object.h"`
`#include "clientutils.h"`

Go to the source code of this file.

## Data Structures

struct | actcalc

## Functions

static void | calc_activity (struct actcalc *calc, const struct tile *ptile, const struct unit *pmodunit, Activity_type_id new_act, const struct extra_type *new_tgt)
int | turns_to_activity_done (const struct tile *ptile, Activity_type_id act, const struct extra_type *tgt, const struct unit *pmodunit)
const char * | concat_tile_activity_text (struct tile *ptile)
void | combat_odds_to_astr (struct astring *str, struct unit_list *punits, const struct tile *ptile, const struct unit *punit, const char *pct_str)

## Function Documentation

## ◆ calc_activity()

static void calc_activity | ( | struct actcalc * | calc,
|  | const struct tile * | ptile,
|  | const struct unit * | pmodunit,
|  | Activity_type_id | new_act,
|  | const struct extra_type * | new_tgt
| ) |  |

static

Calculate completion time for all unit activities on tile. If pmodunit is supplied, take into account the effect if it changed to doing new_act on new_tgt instead of whatever it's currently doing (if anything).

Definition at line 51 of file clientutils.c.

Referenced by concat_tile_activity_text(), and turns_to_activity_done().

## ◆ combat_odds_to_astr()

void combat_odds_to_astr | ( | struct astring * | str,
|  | struct unit_list * | punits,
|  | const struct tile * | ptile,
|  | const struct unit * | punit,
|  | const char * | pct_str
| ) |  |

Add lines about the combat odds to the str.

Definition at line 312 of file clientutils.c.

Referenced by popup_info_text().

## ◆ concat_tile_activity_text()

const char * concat_tile_activity_text | ( | struct tile * | ptile | ) |

Creates the activity progress text for the given tile.

Definition at line 237 of file clientutils.c.

Referenced by popup_info_text().

## ◆ turns_to_activity_done()

int turns_to_activity_done | ( | const struct tile * | ptile,
|  | Activity_type_id | act,
|  | const struct extra_type * | tgt,
|  | const struct unit * | pmodunit
| ) |  |

How many turns until the activity 'act' on target 'tgt' at 'ptile' would be complete, taking into account existing units and possible contribution from 'pmodunit' if it were also to help with the activity ('pmodunit' may be NULL to just account for current activities).

Definition at line 204 of file clientutils.c.

Referenced by real_menus_update().