Freeciv21
Develop your civilization from humble roots to a global empire
spacerace.cpp File Reference
#include "fcintl.h"
#include "shared.h"
#include "calendar.h"
#include "events.h"
#include "game.h"
#include "nation.h"
#include "packets.h"
#include "spaceship.h"
#include "notify.h"
#include "plrhand.h"
#include "spacerace.h"
+ Include dependency graph for spacerace.cpp:

Go to the source code of this file.

Functions

void spaceship_calc_derived (struct player_spaceship *ship)
 Calculate and fill in the derived quantities about the spaceship. More...
 
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 nullptr) to specified destinations. More...
 
void handle_spaceship_launch (struct player *pplayer)
 Handle spaceship launch request. More...
 
void handle_spaceship_place (struct player *pplayer, enum spaceship_place_type type, int num)
 Handle spaceship part placement request. More...
 
bool do_spaceship_place (struct player *pplayer, enum action_requester from, enum spaceship_place_type type, int num)
 Place a spaceship part. More...
 
void spaceship_arrived (struct player *pplayer)
 Handle spaceship arrival. More...
 
void spaceship_lost (struct player *pplayer)
 Handle spaceship loss. More...
 
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). More...
 
int rank_spaceship_arrival (struct player **result)
 Rank launched player spaceships in order of arrival. More...
 

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 206 of file spacerace.cpp.

Referenced by adv_spaceship_autoplace(), and handle_spaceship_place().

◆ handle_spaceship_launch()

void handle_spaceship_launch ( struct player pplayer)

Handle spaceship launch request.

Definition at line 160 of file spacerace.cpp.

Referenced by dai_manage_spaceship().

◆ handle_spaceship_place()

void handle_spaceship_place ( struct player pplayer,
enum spaceship_place_type  type,
int  num 
)

Handle spaceship part placement request.

Definition at line 197 of file spacerace.cpp.

◆ 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 451 of file spacerace.cpp.

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 nullptr) to specified destinations.

If dest is nullptr then game.est_connections is used.

Definition at line 120 of file spacerace.cpp.

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 437 of file spacerace.cpp.

Referenced by check_for_game_over(), and rank_spaceship_arrival().

◆ spaceship_arrived()

void spaceship_arrived ( struct player pplayer)

Handle spaceship arrival.

Definition at line 411 of file spacerace.cpp.

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 37 of file spacerace.cpp.

Referenced by do_spaceship_place(), and sg_load_player_main().

◆ spaceship_lost()

void spaceship_lost ( struct player pplayer)

Handle spaceship loss.

Definition at line 422 of file spacerace.cpp.

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