cp_employee.h

Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2002-2010 UFO: Alien Invasion.
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00017 
00018 See the GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 
00024 */
00025 
00026 #ifndef CLIENT_CL_EMPLOYEE
00027 #define CLIENT_CL_EMPLOYEE
00028 
00029 #define MAX_EMPLOYEES 512
00030 
00031 /******* GUI STUFF ********/
00032 
00033 void E_InitStartup(void);
00034 
00035 /******* BACKEND STUFF ********/
00036 
00049 typedef enum {
00050     EMPL_SOLDIER,
00051     EMPL_SCIENTIST,
00052     EMPL_WORKER,
00053     EMPL_PILOT,
00054     EMPL_ROBOT,
00055     MAX_EMPL        
00056 } employeeType_t;
00057 
00059 typedef struct employee_s {
00060     int idx;                    
00063     base_t *baseHired;          
00065     char speed;                 
00067     building_t *building;       
00069     qboolean transfer;          
00072     character_t chr;            
00073     employeeType_t type;        
00074     struct nation_s *nation;    
00075     const struct ugv_s *ugv;            
00076 } employee_t;
00077 
00078 void E_ResetEmployees(void);
00079 employee_t* E_GetNext(employeeType_t type, employee_t *lastEmployee);
00080 employee_t* E_GetNextFromBase(employeeType_t type, employee_t *lastEmployee, const base_t *base);
00081 employee_t* E_GetNextHired(employeeType_t type, employee_t *lastEmployee);
00082 employee_t* E_CreateEmployee(employeeType_t type, struct nation_s *nation, const struct ugv_s *ugvType);
00083 qboolean E_DeleteEmployee(employee_t *employee, employeeType_t type);
00084 qboolean E_HireEmployee(base_t* base, employee_t* employee);
00085 qboolean E_HireEmployeeByType(base_t* base, employeeType_t type);
00086 qboolean E_HireRobot(base_t* base, const struct ugv_s *ugvType);
00087 qboolean E_UnhireEmployee(employee_t* employee);
00088 void E_RefreshUnhiredEmployeeGlobalList(const employeeType_t type, const qboolean excludeUnhappyNations);
00089 qboolean E_RemoveEmployeeFromBuildingOrAircraft(employee_t *employee);
00090 void E_ResetEmployee(employee_t *employee);
00091 int E_GenerateHiredEmployeesList(const base_t *base);
00092 qboolean E_IsAwayFromBase(const employee_t *employee);
00093 
00094 employeeType_t E_GetEmployeeType(const char* type);
00095 extern const char* E_GetEmployeeString(employeeType_t type);
00096 
00097 employee_t* E_GetEmployee(const base_t* const base, employeeType_t type, int num);
00098 employee_t* E_GetUnhiredRobot(const struct ugv_s *ugvType);
00099 int E_GetHiredEmployees(const base_t* const base, employeeType_t type, linkedList_t **hiredEmployees);
00100 employee_t* E_GetHiredRobot(const base_t* const base, const struct ugv_s *ugvType);
00101 employee_t* E_GetUnassignedEmployee(const base_t* const base, employeeType_t type);
00102 employee_t* E_GetAssignedEmployee(const base_t* const base, employeeType_t type);
00103 employee_t* E_GetHiredEmployeeByUcn(const base_t* const base, employeeType_t type, int ucn);
00104 employee_t* E_GetEmployeeFromChrUCN(int ucn);
00105 qboolean E_MoveIntoNewBase(employee_t *employee, base_t *newBase);
00106 
00107 int E_CountHired(const base_t* const base, employeeType_t type);
00108 int E_CountHiredRobotByType(const base_t* const base, const struct ugv_s *ugvType);
00109 int E_CountAllHired(const base_t* const base);
00110 int E_CountUnhired(employeeType_t type);
00111 int E_CountUnhiredRobotsByType(const struct ugv_s *ugvType);
00112 int E_CountUnassigned(const base_t* const base, employeeType_t type);
00113 employee_t* E_GetEmployeeByMenuIndex(int num);
00114 void E_UnhireAllEmployees(base_t* base, employeeType_t type);
00115 void E_DeleteAllEmployees(base_t* base);
00116 void E_DeleteEmployeesExceedingCapacity(base_t *base);
00117 qboolean E_IsInBase(const employee_t* empl, const base_t* const base);
00118 void E_HireForBuilding(base_t* base, building_t * building, int num);
00119 void E_InitialEmployees(void);
00120 void E_Init(void);
00121 
00122 void E_RemoveInventoryFromStorage(employee_t *employee);
00123 
00124 #define E_IsHired(employee) ((employee)->baseHired != NULL)
00125 
00126 #endif /* CLIENT_CL_EMPLOYEE */

Generated by  doxygen 1.6.2