mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
Merge pull request #3318 from smmalis37/empjobs
Fix docs for employeeProd and add employeeJobs.
This commit is contained in:
commit
674f3b0c9f
4
dist/bitburner.d.ts
vendored
4
dist/bitburner.d.ts
vendored
@ -4671,8 +4671,10 @@ export declare interface Office {
|
||||
maxMor: number;
|
||||
/** Name of all the employees */
|
||||
employees: string[];
|
||||
/** Positions of the employees */
|
||||
/** Production of the employees */
|
||||
employeeProd: EmployeeJobs;
|
||||
/** Positions of the employees */
|
||||
employeeJobs: EmployeeJobs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,6 +29,16 @@ export class OfficeSpace {
|
||||
[EmployeePositions.RandD]: 0,
|
||||
total: 0,
|
||||
};
|
||||
employeeJobs: { [key: string]: number } = {
|
||||
[EmployeePositions.Operations]: 0,
|
||||
[EmployeePositions.Engineer]: 0,
|
||||
[EmployeePositions.Business]: 0,
|
||||
[EmployeePositions.Management]: 0,
|
||||
[EmployeePositions.RandD]: 0,
|
||||
[EmployeePositions.Training]: 0,
|
||||
[EmployeePositions.Unassigned]: 0,
|
||||
total: 0,
|
||||
};
|
||||
|
||||
constructor(params: IParams = {}) {
|
||||
this.loc = params.loc ? params.loc : "";
|
||||
@ -48,6 +58,8 @@ export class OfficeSpace {
|
||||
}
|
||||
}
|
||||
|
||||
this.calculateTotalEmployees(corporation, industry);
|
||||
|
||||
// Process Office properties
|
||||
this.maxEne = 100;
|
||||
this.maxHap = 100;
|
||||
@ -101,6 +113,19 @@ export class OfficeSpace {
|
||||
return salaryPaid;
|
||||
}
|
||||
|
||||
calculateTotalEmployees(corporation: ICorporation, industry: IIndustry): void {
|
||||
//Reset
|
||||
for (const name of Object.keys(this.employeeJobs)) {
|
||||
this.employeeJobs[name] = 0;
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.employees.length; ++i) {
|
||||
const employee = this.employees[i];
|
||||
this.employeeJobs[employee.pos]++;
|
||||
}
|
||||
this.employeeJobs.total = this.employees.length;
|
||||
}
|
||||
|
||||
calculateEmployeeProductivity(corporation: ICorporation, industry: IIndustry): void {
|
||||
//Reset
|
||||
for (const name of Object.keys(this.employeeProd)) {
|
||||
|
@ -753,6 +753,15 @@ export function NetscriptCorporation(
|
||||
"Research & Development": office.employeeProd[EmployeePositions.RandD],
|
||||
Training: office.employeeProd[EmployeePositions.Training],
|
||||
},
|
||||
employeeJobs: {
|
||||
Operations: office.employeeJobs[EmployeePositions.Operations],
|
||||
Engineer: office.employeeJobs[EmployeePositions.Engineer],
|
||||
Business: office.employeeJobs[EmployeePositions.Business],
|
||||
Management: office.employeeJobs[EmployeePositions.Management],
|
||||
"Research & Development": office.employeeJobs[EmployeePositions.RandD],
|
||||
Training: office.employeeJobs[EmployeePositions.Training],
|
||||
Unassigned: office.employeeJobs[EmployeePositions.Unassigned],
|
||||
},
|
||||
};
|
||||
},
|
||||
getEmployee: function (_divisionName: unknown, _cityName: unknown, _employeeName: unknown): NSEmployee {
|
||||
|
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -6965,8 +6965,10 @@ interface Office {
|
||||
maxMor: number;
|
||||
/** Name of all the employees */
|
||||
employees: string[];
|
||||
/** Positions of the employees */
|
||||
/** Production of the employees */
|
||||
employeeProd: EmployeeJobs;
|
||||
/** Positions of the employees */
|
||||
employeeJobs: EmployeeJobs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user