|
UFO: Alien Invasion
|
#include <cp_employee.h>

Public Member Functions | |
| Employee (employeeType_t type, const struct nation_s *nation, const struct ugv_s *ugv) | |
| virtual | ~Employee () |
| bool | isAssigned () const |
| void | setAssigned (bool assigned) |
| bool | isPilot () const |
| bool | isRobot () const |
| bool | isScientist () const |
| bool | isWorker () const |
| bool | isSoldier () const |
| bool | isHired () const |
| bool | isHiredInBase (const base_t *const base) const |
| Checks whether the given employee is in the given base. | |
| employeeType_t | getType () const |
| const struct nation_s * | getNation () const |
| const struct ugv_s * | getUGV () const |
| int | salary () const |
| Calculates the employee's actual salary. | |
| bool | isAwayFromBase () const |
| Tells you if a employee is away from his home base (gone in mission). | |
| bool | unassign () |
| Removes the employee from buildings and aircraft. | |
| bool | unhire () |
| Fires an employee. | |
| void | unequip () |
| Removes the equipment from an employee. | |
Data Fields | |
| base_t * | baseHired |
| bool | transfer |
| character_t | chr |
Private Attributes | |
| const employeeType_t | _type |
| bool | _assigned |
| const struct nation_s * | _nation |
| const struct ugv_s * | _ugv |
The definition of an employee
Definition at line 40 of file cp_employee.h.
|
inline |
|
inlinevirtual |
Definition at line 52 of file cp_employee.h.
|
inline |
Definition at line 103 of file cp_employee.h.
References _nation.
|
inline |
Definition at line 99 of file cp_employee.h.
References _type.
Referenced by AIR_GetPilot(), AIR_RemoveEmployee(), E_DeleteEmployee(), E_HireEmployee(), E_MoveIntoNewBase(), HOS_GetRank(), salary(), TR_Add_f(), and TR_LoadXML().
|
inline |
Definition at line 107 of file cp_employee.h.
References _ugv.
Referenced by BS_SellUGV(), and BS_ShowInfo_f().
|
inline |
true if the employee is not yet assigned to a building Definition at line 58 of file cp_employee.h.
References _assigned.
Referenced by RS_Max_f(), and unassign().
| bool Employee::isAwayFromBase | ( | ) | const |
Tells you if a employee is away from his home base (gone in mission).
Definition at line 75 of file cp_employee.cpp.
References AIR_Foreach, AIR_IsAircraftInBase(), AIR_IsEmployeeInAircraft(), baseHired, isHired(), isPilot(), isRobot(), isSoldier(), and transfer.
|
inline |
Definition at line 86 of file cp_employee.h.
References baseHired.
Referenced by E_EmployeeDelete_f(), E_EmployeeHire_f(), isAwayFromBase(), and unhire().
|
inline |
Checks whether the given employee is in the given base.
| [in] | base | The base the employee must be hired in for this function to return true. |
Definition at line 94 of file cp_employee.h.
References baseHired.
Referenced by TR_Add_f().
|
inline |
Definition at line 66 of file cp_employee.h.
References _type, and EMPL_PILOT.
Referenced by AIR_IsEmployeeInAircraft(), CP_TEAM_AssignSoldierByUCN_f(), and isAwayFromBase().
|
inline |
Definition at line 70 of file cp_employee.h.
References _type, and EMPL_ROBOT.
Referenced by isAwayFromBase().
|
inline |
Definition at line 74 of file cp_employee.h.
References _type, and EMPL_SCIENTIST.
|
inline |
Definition at line 82 of file cp_employee.h.
References _type, and EMPL_SOLDIER.
Referenced by CP_TEAM_ChangeSkin_f(), HOS_Entry(), HOS_GetRank(), and isAwayFromBase().
|
inline |
Definition at line 78 of file cp_employee.h.
References _type, and EMPL_WORKER.
| int Employee::salary | ( | ) | const |
Calculates the employee's actual salary.
Definition at line 63 of file cp_employee.cpp.
References ccs, chr, CL_GetRankByIdx(), getType(), rank_t::level, campaign_t::salaries, and salary().
Referenced by salary().
|
inline |
Definition at line 62 of file cp_employee.h.
References _assigned.
Referenced by E_LoadXML(), RS_AssignScientist(), RS_RemoveFiredScientist(), and RS_RemoveScientist().
| bool Employee::unassign | ( | ) |
Removes the employee from buildings and aircraft.
Definition at line 435 of file cp_employee.cpp.
References _type, AIR_IsEmployeeInAircraft(), AIR_RemoveEmployee(), AIR_RemovePilotFromAssignedAircraft(), baseHired, EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, isAssigned(), and RS_RemoveFiredScientist().
Referenced by unhire().
| void Employee::unequip | ( | ) |
Removes the equipment from an employee.
Definition at line 466 of file cp_employee.cpp.
Referenced by unhire().
| bool Employee::unhire | ( | ) |
Fires an employee.
Definition at line 480 of file cp_employee.cpp.
References _type, baseHired, CAP_AddCurrent(), CAP_EMPLOYEES, CAP_ITEMS, cgi, DEBUG_CLIENT, EMPL_PILOT, EMPL_ROBOT, EMPL_SCIENTIST, EMPL_SOLDIER, EMPL_WORKER, isHired(), MAX_EMPL, PR_UpdateProductionCap(), transfer, UGV_SIZE, unassign(), and unequip().
Referenced by BS_SellUGV(), E_DeleteEmployee(), E_EmployeeDelete_f(), and E_EmployeeHire_f().
|
private |
Assigned to a building - currently only used for scientists
Definition at line 43 of file cp_employee.h.
Referenced by Employee(), isAssigned(), and setAssigned().
|
private |
What nation this employee came from. This is nullptr if the nation is unknown for some (code-related) reason.
Definition at line 44 of file cp_employee.h.
Referenced by Employee(), and getNation().
|
private |
employee type
Definition at line 42 of file cp_employee.h.
Referenced by Employee(), getType(), isPilot(), isRobot(), isScientist(), isSoldier(), isWorker(), unassign(), and unhire().
|
private |
if this is an employee of type EMPL_ROBOT then this is a pointer to the matching ugv_t struct. For normal employees this is nullptr.
Definition at line 45 of file cp_employee.h.
Referenced by Employee(), and getUGV().
| base_t* Employee::baseHired |
Base where the soldier is hired it atm.
Definition at line 117 of file cp_employee.h.
Referenced by BS_SellUGV(), E_DeleteEmployee(), E_HireEmployee(), E_LoadXML(), E_MoveIntoNewBase(), E_RemoveInventoryFromStorage(), Employee(), isAwayFromBase(), isHired(), isHiredInBase(), unassign(), and unhire().
| character_t Employee::chr |
employee stats
Definition at line 119 of file cp_employee.h.
Referenced by AIR_DestroyAircraft(), AIR_GetPilot(), AIR_PilotSurvivedCrash(), AIR_RemoveEmployee(), AIR_SaveAircraftXML(), AIRFIGHT_ActionsAfterAirfight(), AIRFIGHT_ProbabilityToHit(), BS_SellUGV(), CHAR_UpdateData(), CP_TEAM_ChangeSkin_f(), CP_TEAM_DeEquipActor_f(), CP_TEAM_SelectActorByUCN_f(), CP_UpdateActorAircraftVar(), E_ChangeName_f(), E_CreateEmployee(), E_LoadXML(), E_RemoveInventoryFromStorage(), GAME_CP_GetSelectedChr(), HOS_Entry(), HOS_GetInjuryLevelString(), HOS_GetRank(), RS_RemoveFiredScientist(), salary(), and unequip().
| bool Employee::transfer |
Is this employee currently transferred?
Definition at line 118 of file cp_employee.h.
Referenced by AIR_IsEmployeeInAircraft(), E_DeleteEmployee(), Employee(), isAwayFromBase(), TR_LoadXML(), and unhire().