cp_transfer.h File Reference

Header file for Transfer stuff. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  transfer_s
 Transfer informations (they are being stored in ccs.transfers[MAX_TRANSFERS]. More...
struct  transferCargo_s
 Array of current cargo onboard. More...

Defines

#define MAX_TRANSFERS   16
#define TRANS_LIST_EMPTY_SLOT   -1

Typedefs

typedef struct transfer_s transfer_t
 Transfer informations (they are being stored in ccs.transfers[MAX_TRANSFERS].
typedef struct transferCargo_s transferCargo_t
 Array of current cargo onboard.

Enumerations

enum  {
  CARGO_TYPE_INVALID = 0, CARGO_TYPE_ITEM, CARGO_TYPE_EMPLOYEE, CARGO_TYPE_ALIEN_DEAD,
  CARGO_TYPE_ALIEN_ALIVE, CARGO_TYPE_AIRCRAFT, CARGO_TYPE_MAX
}
enum  { TRANS_ALIEN_ALIVE, TRANS_ALIEN_DEAD, TRANS_ALIEN_MAX }

Functions

void TR_TransferCheck (void)
 Checks whether given transfer should be processed.
void TR_NotifyAircraftRemoved (const aircraft_t *aircraft)
 Notify that an aircraft has been removed.
void TR_InitStartup (void)
 Defines commands and cvars for the Transfer menu(s).
void TR_TransferStart (base_t *srcBase, struct transferData_s *transData)
 Starts a transfer.
void TR_TransferAlienAfterMissionStart (const base_t *base, aircraft_t *transferAircraft)
 Starts alien bodies transfer between mission and base.
transfer_tTR_GetNext (transfer_t *lastTransfer)
 Iterates through transfers.

Detailed Description

Header file for Transfer stuff.

Definition in file cp_transfer.h.


Define Documentation

#define MAX_TRANSFERS   16

Definition at line 29 of file cp_transfer.h.

Referenced by TR_TransferAlienAfterMissionStart(), and TR_TransferStart().

#define TRANS_LIST_EMPTY_SLOT   -1

Typedef Documentation

typedef struct transfer_s transfer_t

Transfer informations (they are being stored in ccs.transfers[MAX_TRANSFERS].

Array of current cargo onboard.


Enumeration Type Documentation

anonymous enum
Enumerator:
CARGO_TYPE_INVALID 
CARGO_TYPE_ITEM 
CARGO_TYPE_EMPLOYEE 
CARGO_TYPE_ALIEN_DEAD 
CARGO_TYPE_ALIEN_ALIVE 
CARGO_TYPE_AIRCRAFT 
CARGO_TYPE_MAX 

Definition at line 34 of file cp_transfer.h.

anonymous enum
Enumerator:
TRANS_ALIEN_ALIVE 
TRANS_ALIEN_DEAD 
TRANS_ALIEN_MAX 

Definition at line 45 of file cp_transfer.h.


Function Documentation

transfer_t* TR_GetNext ( transfer_t lastTransfer  ) 

Iterates through transfers.

Parameters:
[in] lastTransfer Pointer of the transfer to iterate from. call with NULL to get the first one.

Definition at line 38 of file cp_transfer.c.

References ccs, ccs_s::numTransfers, and ccs_s::transfers.

Referenced by TR_NotifyAircraftRemoved(), TR_SaveXML(), and TR_TransferCheck().

void TR_InitStartup ( void   ) 

Defines commands and cvars for the Transfer menu(s).

See also:
UI_InitStartup

Definition at line 756 of file cp_transfer.c.

References Cmd_AddCommand().

Referenced by CP_InitStartup().

void TR_NotifyAircraftRemoved ( const aircraft_t aircraft  ) 

Notify that an aircraft has been removed.

Parameters:
[in] aircraft Aircraft that was removed from the game
See also:
AIR_DeleteAircraft

Definition at line 418 of file cp_transfer.c.

References transfer_s::active, transfer_s::aircraftArray, ccs, transfer_s::hasAircraft, aircraft_s::idx, MAX_AIRCRAFT, ccs_s::numAircraft, REMOVE_ELEM_MEMSET, TR_GetNext(), and TRANS_LIST_EMPTY_SLOT.

Referenced by AIR_DeleteAircraft().

void TR_TransferAlienAfterMissionStart ( const base_t base,
aircraft_t transferAircraft 
)
void TR_TransferCheck ( void   ) 

Checks whether given transfer should be processed.

See also:
CL_CampaignRun

Todo:
make it TR_Remove()

Definition at line 438 of file cp_transfer.c.

References transfer_s::active, ccs, ccs_s::date, date_s::day, transfer_s::destBase, transfer_s::event, ccs_s::numTransfers, REMOVE_ELEM, date_s::sec, TR_GetNext(), TR_TransferEnd(), and ccs_s::transfers.

Referenced by CL_CampaignRun().

void TR_TransferStart ( base_t srcBase,
struct transferData_s transData 
)

Starts a transfer.

Parameters:
[in] srcBase start transfer from this base
[in] transData Container holds transfer details

Todo:
This doesn't work - it would require to store the aliens as the first entries in the teamDef array - and this is not guaranteed. The alienAmount array may not contain more than numAliensTD entries though

Definition at line 313 of file cp_transfer.c.

References transfer_s::active, AIR_AircraftGetFromIDX(), AIR_RemoveEmployees(), AIR_TRANSFER, transfer_s::aircraftArray, transfer_s::alienAmount, employee_s::baseHired, ccs, CHRSH_IsTeamDefAlien(), Com_DPrintf(), Com_Error(), Com_Printf(), csi, ccs_s::date, date_s::day, DEBUG_CLIENT, transfer_s::destBase, E_IsInBase(), E_ResetEmployee(), transfer_s::employeeArray, ERR_DROP, transfer_s::event, GetDistanceOnGlobe(), transfer_s::hasAircraft, transfer_s::hasAliens, transfer_s::hasEmployees, transfer_s::hasItems, i, transfer_s::itemAmount, MAX_EMPL, MAX_TRANSFERS, ccs_s::numAircraft, ccs_s::numAliensTD, ccs_s::numEmployees, csi_s::numODs, ccs_s::numTransfers, base_s::pos, PR_ProductionAllowed(), qtrue, RS_ResearchAllowed(), date_s::sec, SECONDS_PER_DAY, transfer_s::srcBase, aircraft_s::status, csi_s::teamDef, transferData_s::trAircraftsTmp, transferData_s::trAliensTmp, TRANS_ALIEN_ALIVE, TRANS_ALIEN_DEAD, TRANS_LIST_EMPTY_SLOT, employee_s::transfer, transferData_s::transferBase, ccs_s::transfers, transferData_s::trCargoCountTmp, transferData_s::trEmployeesTmp, and transferData_s::trItemsTmp.

Referenced by TR_TransferStart_f().


Generated by  doxygen 1.6.2