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

Freeciv-3.3

Loading...
Searching...
No Matches
Functions | Variables
spaceship.c File Reference
`#include "shared.h"`
`#include "spaceship.h"`

Go to the source code of this file.

## Functions

void | spaceship_init (struct player_spaceship *ship)
int | num_spaceship_structurals_placed (const struct player_spaceship *ship)
bool | next_spaceship_component (struct player *pplayer, struct player_spaceship *ship, struct spaceship_component *fill)

## Variables

const struct sship_part_info | structurals_info [NUM_SS_STRUCTURALS]
const struct sship_part_info | components_info [NUM_SS_COMPONENTS]
const struct sship_part_info | modules_info [NUM_SS_MODULES]

## Function Documentation

## ◆ next_spaceship_component()

bool next_spaceship_component | ( | struct player * | pplayer,
|  | struct player_spaceship * | ship,
|  | struct spaceship_component * | fill
| ) |  |

Find (default) place for next spaceship component.

Definition at line 130 of file spaceship.c.

Referenced by adv_spaceship_autoplace(), and spaceship_autoplace().

## ◆ num_spaceship_structurals_placed()

int num_spaceship_structurals_placed | ( | const struct player_spaceship * | ship | ) |

Count the number of structurals placed; that is, in ship->structure[]

Definition at line 113 of file spaceship.c.

Referenced by do_spaceship_place(), and next_spaceship_component().

## ◆ spaceship_init()

void spaceship_init | ( | struct player_spaceship * | ship | ) |

Initialize spaceship struct; can also be used to "cancel" a spaceship (eg, when capital captured).

Definition at line 96 of file spaceship.c.

Referenced by kill_player(), player_defaults(), sg_load_player_main(), sg_load_player_main(), and spaceship_lost().

## Variable Documentation

## ◆ components_info

const struct sship_part_info components_info[NUM_SS_COMPONENTS]

Initial value:
= {
{21, 13, 0},
{24, 13, 12},
{21, 15, 1},
{24, 15, 13},
{21, 9, 8},
{24, 9, 12},
{21, 19, 9},
{24, 19, 13},
{21, 7, 22},
{24, 7, 28},
{21, 21, 23},
{24, 21, 29},
{21, 3, 26},
{24, 3, 28},
{21, 25, 27},
{24, 25, 29}
}

Definition at line 58 of file spaceship.c.

Referenced by next_spaceship_component(), put_spaceship(), and spaceship_calc_derived().

## ◆ modules_info

const struct sship_part_info modules_info[NUM_SS_MODULES]

Initial value:
= {
{16, 12, 0},
{16, 16, 1},
{14, 6, 10},
{12, 16, 15},
{12, 12, 14},
{14, 22, 11},
{ 8, 12, 18},
{ 8, 16, 19},
{ 6, 6, 20},
{ 4, 16, 31},
{ 4, 12, 30},
{ 6, 22, 21}
}

Definition at line 77 of file spaceship.c.

Referenced by next_spaceship_component(), put_spaceship(), and spaceship_calc_derived().

## ◆ structurals_info

const struct sship_part_info structurals_info[NUM_SS_STRUCTURALS]

Definition at line 23 of file spaceship.c.

Referenced by do_spaceship_place(), next_spaceship_component(), and put_spaceship().