mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-10-23 10:13:13 +02:00
27 lines
632 B
TypeScript
27 lines
632 B
TypeScript
/**
|
|
* Augmentation-related methods for the Player class (PlayerObject)
|
|
*/
|
|
import { IPlayer } from "../IPlayer";
|
|
|
|
import { Augmentation } from "../../Augmentation/Augmentation";
|
|
|
|
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, installed = false): boolean {
|
|
const augName: string = aug instanceof Augmentation ? aug.name : aug;
|
|
|
|
for (const owned of this.augmentations) {
|
|
if (owned.name === augName) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
if (!installed) {
|
|
for (const owned of this.queuedAugmentations) {
|
|
if (owned.name === augName) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|