mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 19:14:32 +02:00
23 lines
672 B
TypeScript
23 lines
672 B
TypeScript
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;
|
|
}
|