mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
WIP: Remove corp employees as objects (#143)
* Removed employees as objects from corporations * Remove employees from office JSON after loading / convert to new parameters * Showed down morale/etc gain; added optional position to hireEmployee * enum support for corp employee positions Mostly authored-by: Kelenius <kelenius@ya.ru>
This commit is contained in:
82
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
82
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -6872,6 +6872,20 @@ export interface NS {
|
||||
enums: NSEnums;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
declare enum EmployeePositions {
|
||||
Operations = "Operations",
|
||||
Engineer = "Engineer",
|
||||
Business = "Business",
|
||||
Management = "Management",
|
||||
RandD = "Research & Development",
|
||||
Training = "Training",
|
||||
Unassigned = "Unassigned",
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type EmployeePosNames = `${EmployeePositions}`;
|
||||
|
||||
/** @public */
|
||||
declare enum ToastVariant {
|
||||
SUCCESS = "success",
|
||||
@@ -6903,7 +6917,8 @@ type CrimeNames = `${CrimeType}`;
|
||||
/** @public */
|
||||
export type NSEnums = {
|
||||
toast: typeof ToastVariant;
|
||||
crimes: typeof CrimeType;
|
||||
CrimeType: typeof CrimeType;
|
||||
corp?: { EmployeePositions: typeof EmployeePositions };
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -6912,22 +6927,20 @@ export type NSEnums = {
|
||||
* requires the Office API upgrade from your corporation.
|
||||
* @public
|
||||
*/
|
||||
|
||||
export interface OfficeAPI {
|
||||
/**
|
||||
* Assign an employee to a job.
|
||||
* @param divisionName - Name of the division
|
||||
* @param cityName - Name of the city
|
||||
* @param employeeName - name of the employee
|
||||
* @param job - Name of the job.
|
||||
*/
|
||||
assignJob(divisionName: string, cityName: string, employeeName: string, job: string): void;
|
||||
/**
|
||||
* Hire an employee.
|
||||
* @param divisionName - Name of the division
|
||||
* @param cityName - Name of the city
|
||||
* @returns The newly hired employee, if any
|
||||
* @param employeePosition - Position to place into. Defaults to "Unassigned".
|
||||
* @returns True if an employee was hired, false otherwise
|
||||
*/
|
||||
hireEmployee(divisionName: string, cityName: string): Employee | undefined;
|
||||
hireEmployee(
|
||||
divisionName: string,
|
||||
cityName: string,
|
||||
employeePosition?: EmployeePositions | EmployeePosNames,
|
||||
): boolean;
|
||||
/**
|
||||
* Upgrade office size.
|
||||
* @param divisionName - Name of the division
|
||||
@@ -6975,12 +6988,6 @@ export interface OfficeAPI {
|
||||
* @param employeeName - Name of the employee
|
||||
* @returns Employee data
|
||||
*/
|
||||
getEmployee(divisionName: string, cityName: string, employeeName: string): Employee;
|
||||
/**
|
||||
* Get the cost to Hire AdVert
|
||||
* @param divisionName - Name of the division
|
||||
* @returns Cost
|
||||
*/
|
||||
getHireAdVertCost(divisionName: string): number;
|
||||
/**
|
||||
* Get the number of times you have Hired AdVert
|
||||
@@ -7436,37 +7443,6 @@ interface CorporationInfo {
|
||||
divisions: Division[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Employee in an office
|
||||
* @public
|
||||
*/
|
||||
export interface Employee {
|
||||
/** Name of the employee */
|
||||
name: string;
|
||||
/** Morale of the employee */
|
||||
mor: number;
|
||||
/** Happiness of the employee */
|
||||
hap: number;
|
||||
/** Energy of the employee */
|
||||
ene: number;
|
||||
/** Intelligence of the employee */
|
||||
int: number;
|
||||
/** Charisma of the employee */
|
||||
cha: number;
|
||||
/** Experience of the employee */
|
||||
exp: number;
|
||||
/** Creativity of the employee */
|
||||
cre: number;
|
||||
/** Efficiency of the employee */
|
||||
eff: number;
|
||||
/** Salary of the employee */
|
||||
sal: number;
|
||||
/** Current Location (city) */
|
||||
loc: string;
|
||||
/** Current job position */
|
||||
pos: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Product in a warehouse
|
||||
* @public
|
||||
@@ -7572,8 +7548,14 @@ export interface Office {
|
||||
minMor: number;
|
||||
/** Maximum morale of the employees */
|
||||
maxMor: number;
|
||||
/** Name of all the employees */
|
||||
employees: string[];
|
||||
/** Amount of employees */
|
||||
employees: number;
|
||||
/** Average energy of the employees */
|
||||
avgEne: number;
|
||||
/** Average happiness of the employees */
|
||||
avgHap: number;
|
||||
/** Average morale of the employees */
|
||||
avgMor: number;
|
||||
/** Production of the employees */
|
||||
employeeProd: EmployeeJobs;
|
||||
/** Positions of the employees */
|
||||
|
||||
Reference in New Issue
Block a user