mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
convert some files to ts
This commit is contained in:
22
src/PersonObjects/Player/PlayerObjectCorporationMethods.ts
Normal file
22
src/PersonObjects/Player/PlayerObjectCorporationMethods.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Corporation } from "../../Corporation/Corporation";
|
||||
import { SourceFileFlags } from "../../SourceFile/SourceFileFlags";
|
||||
import { IPlayer } from "../IPlayer";
|
||||
|
||||
export function canAccessCorporation(this: IPlayer): boolean {
|
||||
return this.bitNodeN === 3 || SourceFileFlags[3] > 0;
|
||||
}
|
||||
|
||||
export function hasCorporation(this: IPlayer): boolean {
|
||||
if (this.corporation == null) {
|
||||
return false;
|
||||
}
|
||||
return this.corporation instanceof Corporation;
|
||||
}
|
||||
|
||||
export function startCorporation(this: IPlayer, corpName: string, additionalShares = 0): void {
|
||||
this.corporation = new Corporation({
|
||||
name: corpName,
|
||||
});
|
||||
|
||||
this.corporation.totalShares += additionalShares;
|
||||
}
|
||||
Reference in New Issue
Block a user