bitburner-src/src/SourceFile/SourceFileFlags.ts

19 lines
603 B
TypeScript
Raw Normal View History

// Contains an array containing information about the player's source files
// Array[n] returns what level the player has of Source-File N.
import { CONSTANTS } from "../Constants";
import { IPlayer } from "../PersonObjects/IPlayer";
export const SourceFileFlags: number[] = Array(CONSTANTS.TotalNumBitNodes + 1); // Skip index 0
2021-05-01 09:17:31 +02:00
export function updateSourceFileFlags(p: IPlayer): void {
2021-09-05 01:09:30 +02:00
for (let i = 0; i < SourceFileFlags.length; ++i) {
SourceFileFlags[i] = 0;
}
2021-09-05 01:09:30 +02:00
for (let i = 0; i < p.sourceFiles.length; ++i) {
const sf = p.sourceFiles[i];
SourceFileFlags[sf.n] = sf.lvl;
}
}