Header for employee related stuff. More...
Go to the source code of this file.
Data Structures | |
struct | employee_s |
Defines | |
#define | MAX_EMPLOYEES 512 |
#define | E_IsHired(employee) ((employee)->baseHired != NULL) |
Typedefs | |
typedef struct employee_s | employee_t |
Enumerations | |
enum | employeeType_t { EMPL_SOLDIER, EMPL_SCIENTIST, EMPL_WORKER, EMPL_PILOT, EMPL_ROBOT, MAX_EMPL } |
The types of employees. More... | |
Functions | |
void | E_InitStartup (void) |
This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal. | |
void | E_ResetEmployees (void) |
Clears the employees list for loaded and new games. | |
employee_t * | E_GetNext (employeeType_t type, employee_t *lastEmployee) |
Iterates through employees. | |
employee_t * | E_GetNextFromBase (employeeType_t type, employee_t *lastEmployee, const base_t *base) |
Iterates through employees on a base. | |
employee_t * | E_GetNextHired (employeeType_t type, employee_t *lastEmployee) |
Iterates through hired employees. | |
employee_t * | E_CreateEmployee (employeeType_t type, struct nation_s *nation, const struct ugv_s *ugvType) |
qboolean | E_DeleteEmployee (employee_t *employee, employeeType_t type) |
Removes the employee completely from the game (buildings + global list). | |
qboolean | E_HireEmployee (base_t *base, employee_t *employee) |
Hires the employee in a base. | |
qboolean | E_HireEmployeeByType (base_t *base, employeeType_t type) |
Hires the first free employee of that type. | |
qboolean | E_HireRobot (base_t *base, const struct ugv_s *ugvType) |
qboolean | E_UnhireEmployee (employee_t *employee) |
Fires an employee. | |
void | E_RefreshUnhiredEmployeeGlobalList (const employeeType_t type, const qboolean excludeUnhappyNations) |
Recreates all the employees for a particular employee type in the global list. But it does not overwrite any employees already hired. | |
qboolean | E_RemoveEmployeeFromBuildingOrAircraft (employee_t *employee) |
Remove one employee from building. | |
void | E_ResetEmployee (employee_t *employee) |
Removes the inventory of the employee and also removes him from buildings. | |
int | E_GenerateHiredEmployeesList (const base_t *base) |
Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred). | |
qboolean | E_IsAwayFromBase (const employee_t *employee) |
Tells you if a employee is away from his home base (gone in mission). | |
employeeType_t | E_GetEmployeeType (const char *type) |
Convert string to employeeType_t. | |
const char * | E_GetEmployeeString (employeeType_t type) |
Convert employeeType_t to translated string. | |
employee_t * | E_GetEmployee (const base_t *const base, employeeType_t type, int num) |
Return a given employee pointer in the given base of a given type. Also returns those employees, that are not yet hired. | |
employee_t * | E_GetUnhiredRobot (const struct ugv_s *ugvType) |
int | E_GetHiredEmployees (const base_t *const base, employeeType_t type, linkedList_t **hiredEmployees) |
Return a list of hired employees in the given base of a given type. | |
employee_t * | E_GetHiredRobot (const base_t *const base, const struct ugv_s *ugvType) |
employee_t * | E_GetUnassignedEmployee (const base_t *const base, employeeType_t type) |
Gets an assigned employee of a given type from the given base. | |
employee_t * | E_GetAssignedEmployee (const base_t *const base, employeeType_t type) |
Gets an unassigned employee of a given type from the given base. | |
employee_t * | E_GetHiredEmployeeByUcn (const base_t *const base, employeeType_t type, int ucn) |
employee_t * | E_GetEmployeeFromChrUCN (int ucn) |
Searches all employee for the ucn (character id). | |
qboolean | E_MoveIntoNewBase (employee_t *employee, base_t *newBase) |
int | E_CountHired (const base_t *const base, employeeType_t type) |
Counts hired employees of a given type in a given base. | |
int | E_CountHiredRobotByType (const base_t *const base, const struct ugv_s *ugvType) |
int | E_CountAllHired (const base_t *const base) |
Counts all hired employees of a given base. | |
int | E_CountUnhired (employeeType_t type) |
Counts unhired employees of a given type in a given base. | |
int | E_CountUnhiredRobotsByType (const struct ugv_s *ugvType) |
int | E_CountUnassigned (const base_t *const base, employeeType_t type) |
Counts unassigned employees of a given type in a given base. | |
employee_t * | E_GetEmployeeByMenuIndex (int num) |
Find an hired or free employee by the menu index. | |
void | E_UnhireAllEmployees (base_t *base, employeeType_t type) |
Reset the hired flag for all employees of a given type in a given base. | |
void | E_DeleteAllEmployees (base_t *base) |
Removes all employees completely from the game (buildings + global list) from a given base. | |
void | E_DeleteEmployeesExceedingCapacity (base_t *base) |
Removes employee until all employees fit in quarters capacity. | |
qboolean | E_IsInBase (const employee_t *empl, const base_t *const base) |
Checks whether the given employee is in the given base. | |
void | E_HireForBuilding (base_t *base, building_t *building, int num) |
Hires some employees of appropriate type for a building. | |
void | E_InitialEmployees (void) |
void | E_Init (void) |
void | E_RemoveInventoryFromStorage (employee_t *employee) |
Removes the items of an employee (soldier) from the base storage (s)he is hired at. |
Header for employee related stuff.
Definition in file cp_employee.h.
#define E_IsHired | ( | employee | ) | ((employee)->baseHired != NULL) |
Definition at line 124 of file cp_employee.h.
Referenced by CL_UpdateEmployeeList(), E_CountUnhired(), E_CountUnhiredRobotsByType(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_EmployeeSelect(), E_GetEmployee(), E_GetHiredRobot(), E_GetNextHired(), E_GetUnhiredEmployee(), E_GetUnhiredRobot(), E_IsAwayFromBase(), E_IsInBase(), E_RefreshUnhiredEmployeeGlobalList(), E_ResetEmployee(), and E_UnhireEmployee().
#define MAX_EMPLOYEES 512 |
Definition at line 29 of file cp_employee.h.
Referenced by CL_CleanTempInventory(), E_CreateEmployeeAtIndex(), E_DeleteEmployee(), E_InitialEmployees(), E_LoadXML(), E_RefreshUnhiredEmployeeGlobalList(), TR_CargoListSelect_f(), TR_TransferListSelect_f(), and TR_TransferSelect().
typedef struct employee_s employee_t |
The definition of an employee
enum employeeType_t |
The types of employees.
if (!maxEmployeesInQuarter) maxEmployeesInQuarter = MAX_EMPLOYEES_IN_BUILDING; if (!maxEmployeesWorkersInLab) maxEmployeesWorkersInLab = MAX_EMPLOYEES_IN_BUILDING; if (!maxEmployeesInWorkshop) maxEmployeesInWorkshop = MAX_EMPLOYEES_IN_BUILDING;
EMPL_SOLDIER | |
EMPL_SCIENTIST | |
EMPL_WORKER | |
EMPL_PILOT | |
EMPL_ROBOT | |
MAX_EMPL |
For counting over all available enums. |
Definition at line 49 of file cp_employee.h.
int E_CountAllHired | ( | const base_t *const | base | ) |
Counts all hired employees of a given base.
[in] | base | The base where we count |
Definition at line 1064 of file cp_employee.c.
References count, E_CountHired(), MAX_EMPL, and type.
Referenced by B_ResetAllStatusAndCapacities(), and E_UpdateGUICount_f().
int E_CountHired | ( | const base_t *const | base, | |
employeeType_t | type | |||
) |
Counts hired employees of a given type in a given base.
[in] | base | The base where we count (NULL to count all). |
[in] | type | The type of employee to search. |
Definition at line 1026 of file cp_employee.c.
References count, E_GetNextHired(), and E_IsInBase().
Referenced by B_CheckBuildingStatusForMenu_f(), B_RemoveItemsExceedingCapacity(), B_UpdateStorageCap(), BaseSummary_Init(), CL_ActorPilotSelect_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), CL_AssignSoldier_f(), CL_EquipSoldierState(), E_CountAllHired(), E_UpdateGUICount_f(), PR_CalculateProductionPercentDone(), PR_ProductionAllowed(), PR_ProductionList_f(), PR_QueueNew(), PR_UpdateProductionCap(), RS_ResearchAllowed(), RS_UpdateInfo(), TR_CargoListSelect_f(), and TR_TransferListSelect_f().
int E_CountUnassigned | ( | const base_t *const | base, | |
employeeType_t | type | |||
) |
Counts unassigned employees of a given type in a given base.
[in] | type | The type of employee to search. |
[in] | base | The base where we count |
Definition at line 1117 of file cp_employee.c.
References employee_s::building, count, and E_GetNextFromBase().
Referenced by RS_InitGUI(), and RS_UpdateInfo().
int E_CountUnhired | ( | employeeType_t | type | ) |
Counts unhired employees of a given type in a given base.
[in] | type | The type of employee to search. |
Definition at line 1084 of file cp_employee.c.
References count, E_GetNext(), and E_IsHired.
int E_CountUnhiredRobotsByType | ( | const struct ugv_s * | ugvType | ) |
employee_t* E_CreateEmployee | ( | employeeType_t | type, | |
struct nation_s * | nation, | |||
const struct ugv_s * | ugvType | |||
) |
void E_DeleteAllEmployees | ( | base_t * | base | ) |
Removes all employees completely from the game (buildings + global list) from a given base.
[in] | base | Which base the employee should be fired from. |
Definition at line 851 of file cp_employee.c.
References employee_s::baseHired, ccs, Com_DPrintf(), DEBUG_CLIENT, E_DeleteEmployee(), E_IsInBase(), EMPL_SOLDIER, ccs_s::employees, i, MAX_EMPL, ccs_s::numEmployees, and type.
qboolean E_DeleteEmployee | ( | employee_t * | employee, | |
employeeType_t | type | |||
) |
Removes the employee completely from the game (buildings + global list).
[in] | employee | The pointer to the employee you want to remove. |
[in] | type | What type of employee to delete. |
Definition at line 762 of file cp_employee.c.
References aircraft_s::acTeam, transfer_s::active, AIR_GetNextFromBase(), B_GetFoundedBaseByIDX(), employee_s::baseHired, ccs, Com_DPrintf(), linkedList_s::data, DEBUG_CLIENT, E_UnhireEmployee(), EMPL_PILOT, transfer_s::employeeArray, ccs_s::employees, i, employee_s::idx, MAX_BASES, MAX_EMPL, MAX_EMPLOYEES, linkedList_s::next, ccs_s::numEmployees, ccs_s::numTransfers, aircraft_s::pilot, qfalse, qtrue, employee_s::transfer, ccs_s::transfers, and employee_s::type.
Referenced by AIR_DestroyAircraft(), B_RemoveItemsExceedingCapacity(), CP_MissionEnd(), CP_SpawnRescueMission(), E_DeleteAllEmployees(), E_DeleteEmployeesExceedingCapacity(), and E_EmployeeDelete_f().
void E_DeleteEmployeesExceedingCapacity | ( | base_t * | base | ) |
Removes employee until all employees fit in quarters capacity.
[in] | base | Pointer to the base where the number of employees should be updated. |
Definition at line 889 of file cp_employee.c.
References CAP_EMPLOYEES, base_s::capacities, ccs, Com_Printf(), cap_maxcur_s::cur, E_DeleteEmployee(), E_IsInBase(), EMPL_ROBOT, ccs_s::employees, i, cap_maxcur_s::max, MAX_EMPL, base_s::name, ccs_s::numEmployees, and type.
Referenced by B_BuildingOnDestroy_f().
int E_GenerateHiredEmployeesList | ( | const base_t * | base | ) |
Fill employeeList with a list of employees in the current base (i.e. they are hired and not transferred).
Definition at line 231 of file cp_employee_callbacks.c.
References E_GetHiredEmployees(), EMPL_SOLDIER, and employeesInCurrentList.
Referenced by AIR_AssignInitial().
employee_t* E_GetAssignedEmployee | ( | const base_t *const | base, | |
const employeeType_t | type | |||
) |
Gets an unassigned employee of a given type from the given base.
[in] | base | Which base the employee should be hired in. |
[in] | type | The type of employee to search. |
Definition at line 454 of file cp_employee.c.
References E_EmployeeIsUnassigned(), and E_GetNextFromBase().
Referenced by RS_RemoveScientist().
employee_t* E_GetEmployee | ( | const base_t *const | base, | |
employeeType_t | type, | |||
int | idx | |||
) |
Return a given employee pointer in the given base of a given type. Also returns those employees, that are not yet hired.
[in] | base | Which base the employee should be hired in. |
[in] | type | Which employee type do we search. |
[in] | idx | Which employee id (in global employee array) |
Definition at line 292 of file cp_employee.c.
References E_GetNext(), E_IsHired, E_IsInBase(), employee_s::idx, and MAX_EMPL.
employee_t* E_GetEmployeeByMenuIndex | ( | int | num | ) |
Find an hired or free employee by the menu index.
[in] | num | The index from the hire menu screen (index inemployeeList). |
Definition at line 243 of file cp_employee_callbacks.c.
References LIST_GetByIdx().
Referenced by AIM_AddEmployeeFromMenu(), CL_ActorPilotSelect_f(), CL_ActorTeamSelect_f(), CL_AssignPilot_f(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_EmployeeList_f(), and E_EmployeeSelect_f().
employee_t* E_GetEmployeeFromChrUCN | ( | int | uniqueCharacterNumber | ) |
Searches all employee for the ucn (character id).
[in] | uniqueCharacterNumber | unique character number (UCN) |
Definition at line 1207 of file cp_employee.c.
References employee_s::chr, E_GetNext(), and character_s::ucn.
Referenced by AIR_LoadAircraftXML(), CP_ParseCharacterData(), E_ChangeName_f(), and TR_LoadXML().
const char* E_GetEmployeeString | ( | employeeType_t | type | ) |
Convert employeeType_t to translated string.
type | employeeType_t value |
Definition at line 224 of file cp_employee.c.
References _, Com_Error(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, and ERR_DROP.
Referenced by B_CheckBuildingStatusForMenu_f(), BaseSummary_Init(), CL_StatsUpdate_f(), CP_NationHandleBudget(), HOS_UpdateMenu(), TR_CargoList(), and TR_TransferSelect().
employeeType_t E_GetEmployeeType | ( | const char * | type | ) |
Convert string to employeeType_t.
type | Pointer to employee type string |
Definition at line 248 of file cp_employee.c.
References EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, and MAX_EMPL.
Referenced by CL_ParseRanks().
employee_t* E_GetHiredEmployeeByUcn | ( | const base_t *const | base, | |
employeeType_t | type, | |||
int | ucn | |||
) |
int E_GetHiredEmployees | ( | const base_t *const | base, | |
employeeType_t | type, | |||
linkedList_t ** | hiredEmployees | |||
) |
Return a list of hired employees in the given base of a given type.
[in] | base | Which base the employee should be searched in. If NULL is given employees in all bases will be listed. |
[in] | type | Which employee type to search for. |
[out] | hiredEmployees | Linked list of hired employees in the base. |
Definition at line 371 of file cp_employee.c.
References Com_Printf(), E_GetNextHired(), E_IsInBase(), LIST_AddPointer(), LIST_Count(), LIST_Delete(), MAX_EMPL, and employee_s::transfer.
Referenced by CL_UpdateEmployeeList(), CP_BaseAttackStartMission(), CP_GetWinProbabilty(), E_GenerateHiredEmployeesList(), and E_GetHiredRobot().
employee_t* E_GetHiredRobot | ( | const base_t *const | base, | |
const struct ugv_s * | ugvType | |||
) |
employee_t* E_GetNext | ( | employeeType_t | type, | |
employee_t * | lastEmployee | |||
) |
Iterates through employees.
[in] | type | Employee type to look for |
[in] | lastEmployee | Pointer of the employee to iterate from. call with NULL to get the first one. |
Definition at line 43 of file cp_employee.c.
References ccs, ccs_s::employees, and ccs_s::numEmployees.
Referenced by E_CountUnhired(), E_CountUnhiredRobotsByType(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_GetEmployee(), E_GetEmployeeFromChrUCN(), E_GetNextFromBase(), E_GetNextHired(), E_GetUnhiredEmployee(), E_GetUnhiredRobot(), and E_SaveXML().
employee_t* E_GetNextFromBase | ( | employeeType_t | type, | |
employee_t * | lastEmployee, | |||
const base_t * | base | |||
) |
Iterates through employees on a base.
[in] | type | Employee type to look for |
[in] | lastEmployee | Pointer of the employee to iterate from. call with NULL to get the first one. |
[in] | base | Pointer to the base where employee hired at |
Definition at line 73 of file cp_employee.c.
References E_GetNext(), and E_IsInBase().
Referenced by CL_UpdateCharacterStats(), E_CountUnassigned(), E_GetAssignedEmployee(), E_GetUnassignedEmployee(), E_UnhireAllEmployees(), HOS_HealAll(), HOS_ListClick_f(), HOS_UpdateMenu(), TR_GetTransferEmployee(), TR_TransferListSelect_f(), and TR_TransferSelect().
employee_t* E_GetNextHired | ( | employeeType_t | type, | |
employee_t * | lastEmployee | |||
) |
Iterates through hired employees.
[in] | type | Employee type to look for |
[in] | lastEmployee | Pointer of the employee to iterate from. call with NULL to get the first one. |
Definition at line 91 of file cp_employee.c.
References E_GetNext(), and E_IsHired.
Referenced by CL_StatsUpdate_f(), CP_NationHandleBudget(), E_CountHired(), E_CountHiredRobotByType(), E_GetHiredEmployees(), and HOS_HospitalRun().
employee_t* E_GetUnassignedEmployee | ( | const base_t *const | base, | |
const employeeType_t | type | |||
) |
Gets an assigned employee of a given type from the given base.
[in] | base | Which base the employee should be hired in. |
[in] | type | The type of employee to search. |
Definition at line 472 of file cp_employee.c.
References E_EmployeeIsUnassigned(), and E_GetNextFromBase().
Referenced by RS_AssignScientist(), RS_MaxOutResearch(), and RS_RemoveFiredScientist().
employee_t* E_GetUnhiredRobot | ( | const struct ugv_s * | ugvType | ) |
qboolean E_HireEmployee | ( | base_t * | base, | |
employee_t * | employee | |||
) |
Hires the employee in a base.
[in] | base | Which base the employee should be hired in |
[in] | employee | Which employee to hire |
Definition at line 490 of file cp_employee.c.
References _, AIR_AutoAddPilotToAircraft(), employee_s::baseHired, CAP_EMPLOYEES, CAP_ITEMS, base_s::capacities, cap_maxcur_s::cur, EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, cap_maxcur_s::max, MAX_EMPL, PR_UpdateProductionCap(), qfalse, qtrue, employee_s::type, UGV_SIZE, and UI_Popup().
Referenced by E_EmployeeHire_f(), E_HireEmployeeByType(), E_HireRobot(), and TR_EmptyTransferCargo().
qboolean E_HireEmployeeByType | ( | base_t * | base, | |
employeeType_t | type | |||
) |
Hires the first free employee of that type.
[in] | base | Which base the employee should be hired in |
[in] | type | Which employee type do we search |
Definition at line 530 of file cp_employee.c.
References E_GetUnhiredEmployee(), E_HireEmployee(), and qfalse.
Referenced by B_SetUpFirstBase(), and E_HireForBuilding().
void E_HireForBuilding | ( | base_t * | base, | |
building_t * | building, | |||
int | num | |||
) |
Hires some employees of appropriate type for a building.
[in] | base | Which base the employee should be hired in. |
[in] | building | in which building |
[in] | num | how many employees, if -1, hire building->maxEmployees |
Definition at line 144 of file cp_employee.c.
References B_HANGAR, B_LAB, B_MISC, B_WORKSHOP, building_s::buildingType, ccs, Com_DPrintf(), DEBUG_CLIENT, E_HireEmployeeByType(), EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, building_s::maxEmployees, and ccs_s::numEmployees.
Referenced by B_AddBuildingToBasePos().
void E_Init | ( | void | ) |
void E_InitialEmployees | ( | void | ) |
Definition at line 1143 of file cp_employee.c.
References ccs, Com_GetUGVByID(), ccs_s::curCampaign, E_CreateEmployee(), E_RandomNation(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, frand(), i, MAX_EMPLOYEES, ccs_s::nations, ccs_s::numNations, campaign_s::scientists, campaign_s::soldiers, campaign_s::ugvs, and campaign_s::workers.
Referenced by B_SetUpFirstBase().
void E_InitStartup | ( | void | ) |
This is more or less the initial Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.
Definition at line 1196 of file cp_employee.c.
References Cmd_AddCommand().
Referenced by CP_InitStartup().
qboolean E_IsAwayFromBase | ( | const employee_t * | employee | ) |
Tells you if a employee is away from his home base (gone in mission).
[in] | employee | Pointer to the employee. |
Definition at line 107 of file cp_employee.c.
References AIR_GetNextFromBase(), AIR_IsAircraftInBase(), AIR_IsInAircraftTeam(), employee_s::baseHired, E_IsHired, EMPL_PILOT, EMPL_ROBOT, EMPL_SOLDIER, qfalse, qtrue, employee_s::transfer, and employee_s::type.
Referenced by CP_BaseAttackStartMission(), CP_GetWinProbabilty(), HOS_ListClick_f(), and HOS_UpdateMenu().
qboolean E_IsInBase | ( | const employee_t * | empl, | |
const base_t *const | base | |||
) |
Checks whether the given employee is in the given base.
Definition at line 185 of file cp_employee.c.
References employee_s::baseHired, E_IsHired, qfalse, and qtrue.
Referenced by CP_MissionEnd(), E_CountHired(), E_CountHiredRobotByType(), E_DeleteAllEmployees(), E_DeleteEmployeesExceedingCapacity(), E_EmployeeList_f(), E_EmployeeListScroll_f(), E_GetEmployee(), E_GetHiredEmployees(), E_GetHiredRobot(), E_GetNextFromBase(), and TR_TransferStart().
qboolean E_MoveIntoNewBase | ( | employee_t * | employee, | |
base_t * | newBase | |||
) |
Will change the base where the employee is located in and will also update the capacity in the affected bases.
employee | The employee to change the base for | |
newBase | The base where the employee should be located at |
false
if employee
was a NULL
pointer Definition at line 205 of file cp_employee.c.
References employee_s::baseHired, CAP_EMPLOYEES, base_s::capacities, cap_maxcur_s::cur, qfalse, and qtrue.
Referenced by AIR_MoveAircraftIntoNewHomebase().
void E_RefreshUnhiredEmployeeGlobalList | ( | const employeeType_t | type, | |
const qboolean | excludeUnhappyNations | |||
) |
Recreates all the employees for a particular employee type in the global list. But it does not overwrite any employees already hired.
[in] | type | The type of the employee list to process. |
[in] | excludeUnhappyNations | True if a nation is unhappy then they wont send any pilots, false if happiness of nations in not considered. |
Definition at line 930 of file cp_employee.c.
References ccs, E_CreateEmployeeAtIndex(), E_IsHired, ccs_s::employees, nationInfo_s::happiness, MAX_EMPLOYEES, MAX_NATIONS, ccs_s::nations, ccs_s::numNations, and nation_s::stats.
Referenced by CP_NationHandleBudget().
qboolean E_RemoveEmployeeFromBuildingOrAircraft | ( | employee_t * | employee | ) |
Remove one employee from building.
[in] | employee | What employee to remove from its building. |
Definition at line 972 of file cp_employee.c.
References AIR_IsEmployeeInAircraft(), AIR_RemoveEmployee(), AIR_RemovePilotFromAssignedAircraft(), employee_s::baseHired, employee_s::building, Com_Error(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, ERR_DROP, MAX_EMPL, PR_UpdateProductionCap(), qfalse, qtrue, RS_RemoveFiredScientist(), and employee_s::type.
Referenced by E_ResetEmployee().
void E_RemoveInventoryFromStorage | ( | employee_t * | employee | ) |
Removes the items of an employee (soldier) from the base storage (s)he is hired at.
[in] | employee | Pointer to the soldier whose items should be removed |
Definition at line 1362 of file cp_employee.c.
References B_UpdateStorageAndCapacity(), employee_s::baseHired, employee_s::chr, CONTAINER, csi, INVDEF, invList_s::item, item_s::m, invList_s::next, csi_s::numIDs, qfalse, and item_s::t.
Referenced by AIR_DestroyAircraft().
void E_ResetEmployee | ( | employee_t * | employee | ) |
Removes the inventory of the employee and also removes him from buildings.
Definition at line 555 of file cp_employee.c.
References employee_s::chr, cls, inventoryInterface_s::DestroyInventory, E_IsHired, E_RemoveEmployeeFromBuildingOrAircraft(), character_s::i, and client_static_s::i.
Referenced by E_UnhireEmployee(), and TR_TransferStart().
void E_ResetEmployees | ( | void | ) |
Clears the employees list for loaded and new games.
Definition at line 272 of file cp_employee.c.
References ccs, Com_DPrintf(), DEBUG_CLIENT, EMPL_SOLDIER, ccs_s::employees, i, MAX_EMPL, and ccs_s::numEmployees.
Referenced by CL_ResetSinglePlayerData().
void E_UnhireAllEmployees | ( | base_t * | base, | |
employeeType_t | type | |||
) |
Reset the hired flag for all employees of a given type in a given base.
[in] | base | Which base the employee should be fired from. |
[in] | type | Which employee type do we search. |
Definition at line 614 of file cp_employee.c.
References E_GetNextFromBase(), E_UnhireEmployee(), and MAX_EMPL.
qboolean E_UnhireEmployee | ( | employee_t * | employee | ) |
Fires an employee.
[in] | employee | The employee who will be fired |
Definition at line 577 of file cp_employee.c.
References employee_s::baseHired, CAP_EMPLOYEES, CAP_ITEMS, base_s::capacities, Com_DPrintf(), cap_maxcur_s::cur, DEBUG_CLIENT, E_IsHired, E_ResetEmployee(), EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, MAX_EMPL, qfalse, qtrue, employee_s::transfer, employee_s::type, and UGV_SIZE.
Referenced by BS_SellItem_f(), E_DeleteEmployee(), E_EmployeeDelete_f(), E_EmployeeHire_f(), E_UnhireAllEmployees(), and TR_EmptyTransferCargo().