Freeciv-3.2
Loading...
Searching...
No Matches
Functions
spacerace.h File Reference
#include "fc_types.h"
#include "packets.h"
#include <hand_gen.h>

Go to the source code of this file.

Functions

void spaceship_calc_derived (struct player_spaceship *ship)
 
void send_spaceship_info (struct player *src, struct conn_list *dest)
 
void spaceship_arrived (struct player *pplayer)
 
void spaceship_lost (struct player *pplayer)
 
double spaceship_arrival (const struct player *pplayer)
 
int rank_spaceship_arrival (struct player **result)
 
bool do_spaceship_place (struct player *pplayer, enum action_requester from, enum spaceship_place_type type, int num)
 

Function Documentation

◆ do_spaceship_place()

bool do_spaceship_place ( struct player pplayer,
enum action_requester  from,
enum spaceship_place_type  type,
int  num 
)

Place a spaceship part

Definition at line 215 of file spacerace.c.

Referenced by adv_spaceship_autoplace(), and handle_spaceship_place().

◆ rank_spaceship_arrival()

int rank_spaceship_arrival ( struct player **  result)

Rank launched player spaceships in order of arrival. 'result' is an array big enough to hold all the players. Returns number of launched spaceships, having filled the start of 'result' with that many players in order of predicted arrival. Uses shuffled player order in case of a tie.

Definition at line 460 of file spacerace.c.

Referenced by check_for_game_over().

◆ send_spaceship_info()

void send_spaceship_info ( struct player src,
struct conn_list dest 
)

Send details of src's spaceship (or spaceships of all players if src is NULL) to specified destinations. If dest is NULL then game.est_connections is used.

Definition at line 129 of file spacerace.c.

Referenced by city_build_building(), do_spaceship_place(), handle_spaceship_launch(), kill_player(), send_all_info(), and spaceship_lost().

◆ spaceship_arrival()

double spaceship_arrival ( const struct player pplayer)

Return arrival year of player's spaceship (fractional, as one spaceship may arrive before another in a given year). Only meaningful if spaceship has been launched.

Definition at line 446 of file spacerace.c.

Referenced by check_for_game_over(), and rank_spaceship_arrival().

◆ spaceship_arrived()

void spaceship_arrived ( struct player pplayer)

Handle spaceship arrival.

Definition at line 420 of file spacerace.c.

Referenced by check_for_game_over().

◆ spaceship_calc_derived()

void spaceship_calc_derived ( struct player_spaceship ship)

Calculate and fill in the derived quantities about the spaceship. Data reverse engineered from Civ1. –dwp This could be in common, but its better for the client to take the values the server calculates, in case things change.

Definition at line 46 of file spacerace.c.

Referenced by do_spaceship_place(), sg_load_player_main(), and sg_load_player_main().

◆ spaceship_lost()

void spaceship_lost ( struct player pplayer)

Handle spaceship loss.

Definition at line 431 of file spacerace.c.

Referenced by building_lost(), unit_conquer_city(), and unit_do_destroy_city().